diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2017-02-07 07:05:25 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2017-02-07 07:05:25 -0500 |
commit | 8259e34f61ff13c13372658ee5dc19545e692f39 (patch) | |
tree | bcd5036bd4badb3e928fb738eb9291289a34caef /tests | |
parent | e6368557c0931f2b10c6d1bb64b7b7ee35febc68 (diff) | |
download | python-coveragepy-8259e34f61ff13c13372658ee5dc19545e692f39.tar.gz |
Fix some coverage pragmas
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_phystokens.py | 2 | ||||
-rw-r--r-- | tests/test_process.py | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py index d43b630..5a2c055 100644 --- a/tests/test_phystokens.py +++ b/tests/test_phystokens.py @@ -128,7 +128,7 @@ class SourceEncodingTest(CoverageTest): ) def test_detect_source_encoding_not_in_comment(self): - if env.PYPY and env.PY3: # pramga: no metacov + if env.PYPY and env.PY3: # pragma: no metacov # PyPy3 gets this case wrong. Not sure what I can do about it, # so skip the test. self.skipTest("PyPy3 is wrong about non-comment encoding. Skip it.") diff --git a/tests/test_process.py b/tests/test_process.py index 666d3cc..78e72f7 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -4,6 +4,7 @@ """Tests for process behavior of coverage.py.""" +import distutils.sysconfig # pylint: disable=import-error import glob import os import os.path @@ -1173,17 +1174,16 @@ class UnicodeFilePathsTest(CoverageTest): def possible_pth_dirs(): """Produce a sequence of directories for trying to write .pth files.""" - # First look through sys.path, and we find a .pth file, then it's a good + # First look through sys.path, and if we find a .pth file, then it's a good # place to put ours. - for d in sys.path: - g = glob.glob(os.path.join(d, "*.pth")) - if g: - yield d + for pth_dir in sys.path: # pragma: part covered + pth_files = glob.glob(os.path.join(pth_dir, "*.pth")) + if pth_files: + yield pth_dir # If we're still looking, then try the Python library directory. # https://bitbucket.org/ned/coveragepy/issue/339/pth-test-malfunctions - import distutils.sysconfig # pylint: disable=import-error - yield distutils.sysconfig.get_python_lib() + yield distutils.sysconfig.get_python_lib() # pragma: cant happen def find_writable_pth_directory(): |