diff options
author | loic@dachary.org <loic@dachary.org> | 2016-12-15 18:33:16 +0100 |
---|---|---|
committer | loic@dachary.org <loic@dachary.org> | 2016-12-15 18:33:16 +0100 |
commit | 5c131498d140e172c5471929be4f30c65a200547 (patch) | |
tree | a02534e2f0b9269dea5aca1d8bde889ab859189e /tests/coveragetest.py | |
parent | 88207df5fa00861bf42f0993b23ce541817b72dd (diff) | |
download | python-coveragepy-git-5c131498d140e172c5471929be4f30c65a200547.tar.gz |
also use AST for while constants in python-2.7 #502
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
--HG--
branch : issue-502-7
Diffstat (limited to 'tests/coveragetest.py')
-rw-r--r-- | tests/coveragetest.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py index dacb9b63..4a917192 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('\\', '/') |