summaryrefslogtreecommitdiff
path: root/tests/test_summary.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-11-20 18:46:18 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-11-20 19:36:58 -0500
commit7345085c3983f5f7d05f64da1af8e43da3dc5639 (patch)
tree1bd9d3338bf0a3df09da86b5b874c1d9c5997f2d /tests/test_summary.py
parente2c8f9c7bcf42b9210adbdb28b073fdda14be0d3 (diff)
downloadpython-coveragepy-git-7345085c3983f5f7d05f64da1af8e43da3dc5639.tar.gz
refactor(test): move unicode handling tests to individual test files
Eight fewer sub-processes
Diffstat (limited to 'tests/test_summary.py')
-rw-r--r--tests/test_summary.py17
1 files changed, 17 insertions, 0 deletions
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