MCPcopy
hub / github.com/buildbot/buildbot / test_error

Method test_error

master/buildbot/test/unit/steps/test_subunit.py:88–111  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
106testtools.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()

Callers

nothing calls this directly

Calls 12

ExpectShellClass · 0.90
FakeTestClass · 0.85
create_errorFunction · 0.85
stopTestMethod · 0.80
expect_outcomeMethod · 0.80
expect_log_fileMethod · 0.80
addErrorMethod · 0.45
setup_stepMethod · 0.45
expect_commandsMethod · 0.45
exitMethod · 0.45
stdoutMethod · 0.45
run_stepMethod · 0.45

Tested by

no test coverage detected