diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-10 09:36:12 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-10 09:36:12 -0500 |
commit | 08c37202cb992865e502e6f80e430b5125be1afc (patch) | |
tree | 9e36b74bc3cb0d524b754aa703dbe3df3ce0d208 /tests/test_plugins.py | |
parent | 2869cbd23e637ffeb52536b3b218d8ef91d2d7d7 (diff) | |
download | python-coveragepy-git-08c37202cb992865e502e6f80e430b5125be1afc.tar.gz |
Fix a bad check that was causing mysterious py2/py3 differences
Diffstat (limited to 'tests/test_plugins.py')
-rw-r--r-- | tests/test_plugins.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 2b4b2ee1..0d57bc97 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -284,6 +284,10 @@ class FileTracerTest(CoverageTest): # quux_5.html will be omitted from the results. assert render("quux_5.html", 3) == "[quux_5.html @ 3]" + + # In Python 2, either kind of string should be OK. + if type("") == type(b""): + assert render(u"unicode_3.html", 2) == "[unicode_3.html @ 2]" """) cov = coverage.Coverage(omit=["*quux*"]) @@ -307,3 +311,9 @@ class FileTracerTest(CoverageTest): self.assertIn("bar_4.html", cov.data.summary()) self.assertNotIn("quux_5.html", cov.data.summary()) + + if env.PY2: + _, statements, missing, _ = cov.analysis("unicode_3.html") + self.assertEqual(statements, [1, 2, 3]) + self.assertEqual(missing, [1]) + self.assertIn("unicode_3.html", cov.data.summary()) |