01-fix-tests.patch 1.1 KB

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