Skip to content

Commit 2de8b5a

Browse files
test: Add no cover pragmas to WIN-specific code
1 parent 3acff83 commit 2de8b5a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

test/test_nodely.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,26 @@ def test_install_non_existent():
3535
def test_which(node_package, node_package_command):
3636
nodely.install(node_package)
3737
path = Path(nodely.NODE_MODULES_DIR / '.bin' / node_package_command)
38-
if WIN:
38+
if WIN: # pragma: no cover
3939
path += '.cmd'
4040
assert nodely.which(node_package_command).normcase() == path.normcase()
4141
assert nodely.which('non-existent') is None
4242

4343

44-
def test_Popen(node_package_command, node_package_command_args,
45-
node_package_command_output_regex):
46-
process = nodely.Popen(node_package_command, node_package_command_args,
47-
stdout=PIPE, stderr=PIPE, universal_newlines=True)
44+
def test_Popen(
45+
node_package_command, node_package_command_args,
46+
node_package_command_output_regex):
47+
process = nodely.Popen(
48+
node_package_command, node_package_command_args,
49+
stdout=PIPE, stderr=PIPE, universal_newlines=True)
4850
out, err = process.communicate()
4951
assert node_package_command_output_regex.match(out.strip())
5052
assert not err
5153

5254

53-
def test_call(capfd, node_package_command, node_package_command_args,
54-
node_package_command_output_regex):
55+
def test_call(
56+
capfd, node_package_command, node_package_command_args,
57+
node_package_command_output_regex):
5558
assert nodely.call(node_package_command, node_package_command_args) is 0
5659
out, err = capfd.readouterr()
5760
assert node_package_command_output_regex.match(out.strip())

test/test_nodely_bin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test__dir__(self):
6060
cmdnames = (
6161
f.basename()
6262
for f in (nodely.bin.NODE_MODULES_DIR / '.bin').files())
63-
if WIN:
63+
if WIN: # pragma: no cover
6464
cmdnames = (cmd for cmd in cmdnames if cmd.ext.lower() != '.cmd')
6565
assert set(cmdnames).issubset(dir(nodely.bin))
6666

0 commit comments

Comments
 (0)