diff options
| author | Ruben Vorderman <r.h.p.vorderman@lumc.nl> | 2021-02-25 11:30:24 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-25 11:30:24 (GMT) |
| commit | cc3df6368d4f3f6c9c9b716876c7e7b79c7abf3f (patch) | |
| tree | 6a598c147f5595f16b665a88cad789ca8fcf5742 /Lib/test/test_gzip.py | |
| parent | 70f8ebe503fc7748db9b0c51cfbba20b1846a3c8 (diff) | |
| download | cpython-cc3df6368d4f3f6c9c9b716876c7e7b79c7abf3f.zip cpython-cc3df6368d4f3f6c9c9b716876c7e7b79c7abf3f.tar.gz cpython-cc3df6368d4f3f6c9c9b716876c7e7b79c7abf3f.tar.bz2 | |
bpo-43316: gzip: CLI uses non-zero return code on error. (GH-24647)
Exit code is now 1 instead of 0. A message is printed to stderr instead of stdout. This is
the proper behaviour for a tool that can be used in scripts.
Diffstat (limited to 'Lib/test/test_gzip.py')
| -rw-r--r-- | Lib/test/test_gzip.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index c3fa9b0..1bb8f7a 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -774,10 +774,10 @@ class TestCommandLine(unittest.TestCase): self.assertEqual(err, b'') def test_decompress_infile_outfile_error(self): - rc, out, err = assert_python_ok('-m', 'gzip', '-d', 'thisisatest.out') - self.assertIn(b"filename doesn't end in .gz:", out) - self.assertEqual(rc, 0) - self.assertEqual(err, b'') + rc, out, err = assert_python_failure('-m', 'gzip', '-d', 'thisisatest.out') + self.assertIn(b"filename doesn't end in .gz:", err) + self.assertEqual(rc, 1) + self.assertEqual(out, b'') @create_and_remove_directory(TEMPDIR) def test_compress_stdin_outfile(self): |
