(self)
| 86 | return self.run_step() |
| 87 | |
| 88 | def test_error(self): |
| 89 | stream = io.BytesIO() |
| 90 | client = TestProtocolClient(stream) |
| 91 | test = FakeTest(id='test1') |
| 92 | client.startTest(test) |
| 93 | client.addError(test, create_error('error1')) |
| 94 | client.stopTest(test) |
| 95 | |
| 96 | self.setup_step(subunit.SubunitShellCommand(command='test')) |
| 97 | self.expect_commands( |
| 98 | ExpectShell(workdir='wkdir', command="test").stdout(stream.getvalue()).exit(0) |
| 99 | ) |
| 100 | |
| 101 | self.expect_outcome(result=FAILURE, state_string="shell Total 1 test(s) 1 error (failure)") |
| 102 | self.expect_log_file( |
| 103 | 'problems', |
| 104 | re.compile( |
| 105 | r"""test1 |
| 106 | testtools.testresult.real._StringException:.*ValueError: invalid literal for int\(\) with base 10: '_error1' |
| 107 | .*""", |
| 108 | re.MULTILINE | re.DOTALL, |
| 109 | ), |
| 110 | ) |
| 111 | return self.run_step() |
| 112 | |
| 113 | def test_multiple_errors(self): |
| 114 | stream = io.BytesIO() |
nothing calls this directly
no test coverage detected