(self)
| 189 | self.assertEqual(c.exception.returncode, 47) |
| 190 | |
| 191 | def test_check_output(self): |
| 192 | # check_output() function with zero return code |
| 193 | output = subprocess.check_output( |
| 194 | [sys.executable, "-c", "print('BDFL')"]) |
| 195 | self.assertIn(b'BDFL', output) |
| 196 | |
| 197 | with self.assertRaisesRegex(ValueError, |
| 198 | "stdout argument not allowed, it will be overridden"): |
| 199 | subprocess.check_output([], stdout=None) |
| 200 | |
| 201 | with self.assertRaisesRegex(ValueError, |
| 202 | "check argument not allowed, it will be overridden"): |
| 203 | subprocess.check_output([], check=False) |
| 204 | |
| 205 | def test_check_output_nonzero(self): |
| 206 | # check_call() function with non-zero return code |
nothing calls this directly
no test coverage detected