summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 6f142100..1018ff09 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -100,6 +100,16 @@ class ApiTest(CoverageTest):
filename, _, _, _ = cov.analysis(sys.modules["mymod"])
self.assertEqual(os.path.basename(filename), "mymod.py")
+ def test_unencodable_filename(self):
+ code = """a = 1\nb = 2\n"""
+ cov = coverage.Coverage()
+ cov.start()
+ globs = {}
+ exec(compile(code, "wut\xe9\xea\xeb\xec\x01\x02.py", 'exec'), globs)
+ cov.stop()
+ self.assertEqual(globs['a'], 1)
+ self.assertEqual(globs['b'], 2)
+
def test_ignore_stdlib(self):
self.make_file("mymain.py", """\
import colorsys