diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2017-03-29 20:07:05 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2017-03-29 20:07:05 -0400 |
commit | ba61e502586e4693d9c626d77389f55163e29de2 (patch) | |
tree | c9936613090029561a0765bb0c116b9f7d751dc0 | |
parent | e79c990759f5cb7d84fc90d679368ab8d9009f8a (diff) | |
download | python-coveragepy-git-ba61e502586e4693d9c626d77389f55163e29de2.tar.gz |
Clean up in plugin tests
-rw-r--r-- | tests/plugin1.py | 2 | ||||
-rw-r--r-- | tests/test_plugins.py | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/tests/plugin1.py b/tests/plugin1.py index af4dfc52..63ebacf7 100644 --- a/tests/plugin1.py +++ b/tests/plugin1.py @@ -24,7 +24,7 @@ class FileTracer(coverage.FileTracer): """A FileTracer emulating a simple static plugin.""" def __init__(self, filename): - """Claim that xyz.py was actually sourced from ABC.zz""" + """Claim that */*xyz.py was actually sourced from /src/*ABC.zz""" self._filename = filename self._source_filename = os.path.join( "/src", diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 8ea0a8f5..0edfebe8 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -333,9 +333,8 @@ class GoodPluginTest(FileTracerTest): # 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 sys.version_info[0] == 2: - assert render(u"uni_3.html", 2) == "[uni_3.html @ 2]" + # For Python 2, make sure unicode is working. + assert render(u"uni_3.html", 2) == "[uni_3.html @ 2]" """) # will try to read the actual source files, so make some @@ -372,11 +371,10 @@ class GoodPluginTest(FileTracerTest): self.assertNotIn("quux_5.html", cov.data.line_counts()) - if env.PY2: - _, statements, missing, _ = cov.analysis("uni_3.html") - self.assertEqual(statements, [1, 2, 3]) - self.assertEqual(missing, [1]) - self.assertIn("uni_3.html", cov.data.line_counts()) + _, statements, missing, _ = cov.analysis("uni_3.html") + self.assertEqual(statements, [1, 2, 3]) + self.assertEqual(missing, [1]) + self.assertIn("uni_3.html", cov.data.line_counts()) def test_plugin2_with_branch(self): self.make_render_and_caller() |