diff options
author | Justas Sadzevičius <justas.sadzevicius@gmail.com> | 2019-04-21 06:02:09 +0300 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-04-20 23:02:09 -0400 |
commit | 4a5ad41f106d6d9fff97e10cae3571b7b67823d5 (patch) | |
tree | 1c1555ea6cb2c86f15dc528ce65d0e34e62e4e32 /tests/coveragetest.py | |
parent | a92f0023e015a82f8c875e7a90210e22aaf0174b (diff) | |
download | python-coveragepy-git-4a5ad41f106d6d9fff97e10cae3571b7b67823d5.tar.gz |
Plugin support for dynamic context (#783)
* Introduce a new plugin type: dynamic context labels.
* Test dynamic context plugins
* Helper method to get full paths to measured files
* Get correct filenames on all OS
* Improve wording
Diffstat (limited to 'tests/coveragetest.py')
-rw-r--r-- | tests/coveragetest.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py index 98c1e087..c0a8fb5a 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -8,6 +8,7 @@ import datetime import functools import glob import os +import os.path import random import re import shlex @@ -514,6 +515,15 @@ class CoverageTest( """Return the last line of `report` with the spaces squeezed down.""" return self.squeezed_lines(report)[-1] + def get_measured_filenames(self, coverage_data): + """Get paths to measured files. + + Returns a dict of {filename: absolute path to file} + for given CoverageData. + """ + return {os.path.basename(filename): filename + for filename in coverage_data.measured_files()} + class UsingModulesMixin(object): """A mixin for importing modules from tests/modules and tests/moremodules.""" |