From 7345085c3983f5f7d05f64da1af8e43da3dc5639 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 20 Nov 2021 18:46:18 -0500 Subject: refactor(test): move unicode handling tests to individual test files Eight fewer sub-processes --- tests/test_summary.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/test_summary.py') diff --git a/tests/test_summary.py b/tests/test_summary.py index ae1153b9..dcf244a1 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -552,6 +552,23 @@ class SummaryTest(UsingModulesMixin, CoverageTest): with pytest.raises(NotPython, match=msg): self.get_report(cov, morfs=["mycode.py"]) + def test_accented_directory(self): + # Make a file with a non-ascii character in the directory name. + self.make_file("\xe2/accented.py", "print('accented')") + self.make_data_file(lines={abs_file("\xe2/accented.py"): [1]}) + report_expected = ( + "Name Stmts Miss Cover\n" + + "-----------------------------------\n" + + "\xe2/accented.py 1 0 100%\n" + + "-----------------------------------\n" + + "TOTAL 1 0 100%\n" + ) + + cov = coverage.Coverage() + cov.load() + output = self.get_report(cov, squeeze=False) + assert output == report_expected + @pytest.mark.skipif(env.JYTHON, reason="Jython doesn't like accented file names") def test_accenteddotpy_not_python(self): # We run a .py file with a non-ascii name, and when reporting, we can't -- cgit v1.2.1