Skip to content

Commit 270c742

Browse files
committed
Fix some coverage pragmas
1 parent e746941 commit 270c742

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/test_phystokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_detect_source_encoding(self):
128128
)
129129

130130
def test_detect_source_encoding_not_in_comment(self):
131-
if env.PYPY and env.PY3: # pramga: no metacov
131+
if env.PYPY and env.PY3: # pragma: no metacov
132132
# PyPy3 gets this case wrong. Not sure what I can do about it,
133133
# so skip the test.
134134
self.skipTest("PyPy3 is wrong about non-comment encoding. Skip it.")

tests/test_process.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
"""Tests for process behavior of coverage.py."""
66

7+
import distutils.sysconfig # pylint: disable=import-error
78
import glob
89
import os
910
import os.path
@@ -1173,17 +1174,16 @@ def test_accented_directory(self):
11731174

11741175
def possible_pth_dirs():
11751176
"""Produce a sequence of directories for trying to write .pth files."""
1176-
# First look through sys.path, and we find a .pth file, then it's a good
1177+
# First look through sys.path, and if we find a .pth file, then it's a good
11771178
# place to put ours.
1178-
for d in sys.path:
1179-
g = glob.glob(os.path.join(d, "*.pth"))
1180-
if g:
1181-
yield d
1179+
for pth_dir in sys.path: # pragma: part covered
1180+
pth_files = glob.glob(os.path.join(pth_dir, "*.pth"))
1181+
if pth_files:
1182+
yield pth_dir
11821183

11831184
# If we're still looking, then try the Python library directory.
11841185
# https://bitbucket.org/ned/coveragepy/issue/339/pth-test-malfunctions
1185-
import distutils.sysconfig # pylint: disable=import-error
1186-
yield distutils.sysconfig.get_python_lib()
1186+
yield distutils.sysconfig.get_python_lib() # pragma: cant happen
11871187

11881188

11891189
def find_writable_pth_directory():

0 commit comments

Comments
 (0)