diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2019-12-23 15:40:44 -0500 | 
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-12-23 18:01:49 -0500 | 
| commit | 7c78d66bf029796961ed528b1d00c561aaa8ceb7 (patch) | |
| tree | 176739a03e96ca31d31be567ef34e528074283cb | |
| parent | f9789d5ca9102775385dee93ad0c2e1876391033 (diff) | |
| download | python-coveragepy-git-7c78d66bf029796961ed528b1d00c561aaa8ceb7.tar.gz | |
Confirm that run_command will show us both stdout and stderr
| -rw-r--r-- | tests/test_testing.py | 11 | 
1 files changed, 11 insertions, 0 deletions
| diff --git a/tests/test_testing.py b/tests/test_testing.py index 15e6f84f..cf3e2014 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -205,6 +205,17 @@ class CoverageTestTest(CoverageTest):          _, _, environ = environ.rpartition(":")          self.assertEqual(environ.strip(), "COV_FOOBAR = XYZZY") +    def test_run_command_stdout_stderr(self): +        # run_command should give us both stdout and stderr. +        self.make_file("outputs.py", """\ +            import sys +            sys.stderr.write("StdErr\\n") +            print("StdOut") +            """) +        out = self.run_command("python outputs.py") +        self.assertIn("StdOut\n", out) +        self.assertIn("StdErr\n", out) +  class CheckUniqueFilenamesTest(CoverageTest):      """Tests of CheckUniqueFilenames.""" | 
