Skip to content

Commit

Permalink
fixup! Add tests for pr 2540, improve _test_expected_error
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Dec 10, 2024
1 parent 8fed3fc commit 0daf759
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions misc/output_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ class Output(unittest.TestCase):
'',
))

def _test_expected_error(self, plan: str, flags: T.Optional[str], expected: str, *args, **kwargs):
def _test_expected_error(self, plan: str, flags: T.Optional[str],expected: str,
*args, exit_code: T.Optional[int]=None, **kwargs)->None:
"""Run Ninja with a given plan and flags, and verify its cooked output against an expected content.
All *args and **kwargs are passed to the `run`, except `exit_code`
All *args and **kwargs are passed to the `run` function
"""
actual = ''
kwargs['print_err_output'] = False
exit_code = kwargs.pop("exit_code", None)
with self.assertRaises(subprocess.CalledProcessError) as cm:
run(plan, flags, *args, **kwargs)
actual = cm.exception.cooked_output
Expand Down

0 comments on commit 0daf759

Please sign in to comment.