From 08c37202cb992865e502e6f80e430b5125be1afc Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 10 Feb 2015 09:36:12 -0500 Subject: Fix a bad check that was causing mysterious py2/py3 differences --- tests/test_plugins.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') 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()) -- cgit v1.2.1