diff -rU3 chardet-3.0.4-orig/test.py chardet-3.0.4/test.py --- chardet-3.0.4-orig/test.py 2019-10-03 13:29:21.914988914 +0200 +++ chardet-3.0.4/test.py 2019-10-03 13:51:34.783256817 +0200 @@ -19,7 +19,27 @@ HAVE_HYPOTHESIS = True except ImportError: HAVE_HYPOTHESIS = False -import pytest +try: + import pytest +except ImportError: + class pytest: + """Just enough pytest API to run the tests""" + class mark: + @staticmethod + def parametrize(name_string, cases): + """Run all given tests""" + def decorator(func): + names = name_string.split(', ') + for case in cases: + print(case) + func(**{name: val for name, val in zip(names, case)}) + return decorator + + @staticmethod + def xfail(): + """Don't run this test""" + pass + import chardet @@ -59,7 +79,7 @@ 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) + continue yield test_case