--- contrib/python/chardet/py3/test.py (index) +++ contrib/python/chardet/py3/test.py (working tree) @@ -45,7 +45,8 @@ EXPECTED_FAILURES = { def gen_test_params(): """Yields tuples of paths and encodings to use for test_encoding_detection""" - base_path = relpath(join(dirname(realpath(__file__)), "tests")) + import yatest.common + base_path = yatest.common.work_path('test_data/tests') for encoding in listdir(base_path): path = join(base_path, encoding) # Skip files in tests directory @@ -68,8 +69,11 @@ def gen_test_params(): continue full_path = join(path, file_name) test_case = full_path, encoding - if full_path in EXPECTED_FAILURES: - test_case = pytest.param(*test_case, marks=pytest.mark.xfail) + name_test = full_path.split("/test_data/")[-1] + if name_test in EXPECTED_FAILURES: + test_case = pytest.param(*test_case, marks=pytest.mark.xfail, id=name_test) + else: + test_case = pytest.param(*test_case, id=name_test) yield test_case