summaryrefslogtreecommitdiff
path: root/tests/coveragetest.py
diff options
context:
space:
mode:
authorloic <loic@dachary.org>2016-12-15 18:33:16 +0100
committerloic <loic@dachary.org>2016-12-15 18:33:16 +0100
commit580e24f3cf0e991b400e1a254d7cc9220b0c1a4c (patch)
treefb1e1712e2c112aa353352577abf25df8735d2a9 /tests/coveragetest.py
parent65eefc5a62d5fae39921e7608039c1deff6be614 (diff)
downloadpython-coveragepy-issue-502-7.tar.gz
also use AST for while constants in python-2.7 #502issue-502-7
The node.id is set to False, True or None is python-2.7: there is no reason to only check for it with python-3. It is more reliable than using the DEFAULT_PARTIAL_ALWAYS regexps on source lines. close #502
Diffstat (limited to 'tests/coveragetest.py')
-rw-r--r--tests/coveragetest.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py
index dacb9b6..4a91719 100644
--- a/tests/coveragetest.py
+++ b/tests/coveragetest.py
@@ -397,9 +397,8 @@ class CoverageTest(
# Add our test modules directory to PYTHONPATH. I'm sure there's too
# much path munging here, but...
- here = os.path.dirname(self.nice_file(coverage.__file__, ".."))
- testmods = self.nice_file(here, 'tests/modules')
- zipfile = self.nice_file(here, 'tests/zipmods.zip')
+ testmods = self.nice_file(self.here(), 'tests/modules')
+ zipfile = self.nice_file(self.here(), 'tests/zipmods.zip')
pypath = os.getenv('PYTHONPATH', '')
if pypath:
pypath += os.pathsep
@@ -410,6 +409,9 @@ class CoverageTest(
print(self.last_command_output)
return self.last_command_status, self.last_command_output
+ def here(self):
+ return os.path.dirname(self.nice_file(coverage.__file__, ".."))
+
def report_from_command(self, cmd):
"""Return the report from the `cmd`, with some convenience added."""
report = self.run_command(cmd).replace('\\', '/')