summaryrefslogtreecommitdiff
path: root/tests/test_cmdline.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-02-02 10:53:27 -0500
committerGitHub <noreply@github.com>2021-02-02 10:53:27 -0500
commitb7160a896252bb92ffe921a37e3cde98c5cb78b9 (patch)
treea0edae6ca0996217b9f0fa3213f824eab8b1cbe1 /tests/test_cmdline.py
parent35d91c7aa186a84d0edb333bad60b520f3b1d719 (diff)
parent80c021d9174e7ae3e5183f1902903fb90a891246 (diff)
downloadpython-coveragepy-git-b7160a896252bb92ffe921a37e3cde98c5cb78b9.tar.gz
Merge pull request #1113 from nedbat/nedbat/capsys
More unittest removal
Diffstat (limited to 'tests/test_cmdline.py')
-rw-r--r--tests/test_cmdline.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index a0744452..0eb26cd0 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -545,8 +545,9 @@ class CmdLineTest(BaseCmdLineTest):
# config file.
self.command_line("run --concurrency=multiprocessing --branch foo.py", ret=ERR)
msg = "Options affecting multiprocessing must only be specified in a configuration file."
- assert msg in self.stderr()
- assert "Remove --branch from the command line." in self.stderr()
+ _, err = self.stdouterr()
+ assert msg in err
+ assert "Remove --branch from the command line." in err
def test_run_debug(self):
self.cmd_executes("run --debug=opt1 foo.py", """\
@@ -915,8 +916,9 @@ class CmdMainTest(CoverageTest):
def test_raise(self):
ret = coverage.cmdline.main(['raise'])
assert ret == 1
- assert self.stdout() == ""
- err = self.stderr().split('\n')
+ out, err = self.stdouterr()
+ assert out == ""
+ err = err.split('\n')
assert err[0] == 'Traceback (most recent call last):'
assert err[-3] == ' raise Exception("oh noes!")'
assert err[-2] == 'Exception: oh noes!'