summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-10-21 12:13:56 -0400
committerNed Batchelder <ned@nedbatchelder.com>2017-10-21 12:13:56 -0400
commit62617a3a8ac8908d772695512cb3cf05945efcb8 (patch)
treedee458395445ff90fd3c2e3c510327915746d734
parentbcab18da36f04fd7621f8e65ce75eb99969e19cf (diff)
downloadpython-coveragepy-git-62617a3a8ac8908d772695512cb3cf05945efcb8.tar.gz
Fix the recent command-name tests for Windows
-rw-r--r--tests/test_cmdline.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index a2c693a4..7ef474e0 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -3,6 +3,7 @@
"""Test cmdline.py for coverage.py."""
+import os
import pprint
import re
import sys
@@ -644,7 +645,7 @@ class CmdLineStdoutTest(BaseCmdLineTest):
def test_help_contains_command_name(self):
# Command name should be present in help output.
- fake_command_path = "lorem/ipsum/dolor"
+ fake_command_path = "lorem/ipsum/dolor".replace("/", os.sep)
expected_command_name = "dolor"
fake_argv = [fake_command_path, "sit", "amet"]
with mock.patch.object(sys, 'argv', new=fake_argv):
@@ -659,7 +660,7 @@ class CmdLineStdoutTest(BaseCmdLineTest):
# has the `__main__.py` file's patch as the command name. Instead, the command name should
# be derived from the package name.
- fake_command_path = "lorem/ipsum/dolor/__main__.py"
+ fake_command_path = "lorem/ipsum/dolor/__main__.py".replace("/", os.sep)
expected_command_name = "dolor"
fake_argv = [fake_command_path, "sit", "amet"]
with mock.patch.object(sys, 'argv', new=fake_argv):