summaryrefslogtreecommitdiff
path: root/tests/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-02-07 07:05:25 -0500
committerNed Batchelder <ned@nedbatchelder.com>2017-02-07 07:05:25 -0500
commit270c7425f42d309c5e745e8f6d9ac85284cf43f8 (patch)
tree7ba8fe54e8e4f0602f63bd214a0663faccc4b25c /tests/test_process.py
parente7469411838a9877bbf8176566224b7756c9546d (diff)
downloadpython-coveragepy-git-270c7425f42d309c5e745e8f6d9ac85284cf43f8.tar.gz
Fix some coverage pragmas
Diffstat (limited to 'tests/test_process.py')
-rw-r--r--tests/test_process.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_process.py b/tests/test_process.py
index 666d3cc4..78e72f7b 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():