summaryrefslogtreecommitdiff
path: root/tests/test_cmdline.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-24 09:53:53 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-24 09:53:53 -0400
commit20baf284341555803d800ec4c248fd0f1b5351f1 (patch)
tree315429176663e477a732c2fe9c0ad42f63fde0f3 /tests/test_cmdline.py
parent4902b6c53740c8e871bb03e69e4345c5cafad96e (diff)
downloadpython-coveragepy-git-20baf284341555803d800ec4c248fd0f1b5351f1.tar.gz
refactor(test): os_sep and remove_tree helpers
Diffstat (limited to 'tests/test_cmdline.py')
-rw-r--r--tests/test_cmdline.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index caaa43c8..7b558bbb 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -3,7 +3,6 @@
"""Test cmdline.py for coverage.py."""
-import os
import pprint
import sys
import textwrap
@@ -20,6 +19,7 @@ from coverage.exceptions import ExceptionDuringRun
from coverage.version import __url__
from tests.coveragetest import CoverageTest, OK, ERR, command_line
+from tests.helpers import os_sep
class BaseCmdLineTest(CoverageTest):
@@ -818,7 +818,7 @@ class CmdLineStdoutTest(BaseCmdLineTest):
@pytest.mark.skipif(env.JYTHON, reason="Jython gets mad if you patch sys.argv")
def test_help_contains_command_name(self):
# Command name should be present in help output.
- fake_command_path = "lorem/ipsum/dolor".replace("/", os.sep)
+ fake_command_path = os_sep("lorem/ipsum/dolor")
expected_command_name = "dolor"
fake_argv = [fake_command_path, "sit", "amet"]
with mock.patch.object(sys, 'argv', new=fake_argv):
@@ -834,7 +834,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".replace("/", os.sep)
+ fake_command_path = os_sep("lorem/ipsum/dolor/__main__.py")
expected_command_name = "dolor"
fake_argv = [fake_command_path, "sit", "amet"]
with mock.patch.object(sys, 'argv', new=fake_argv):