Skip to content

Commit

Permalink
Desensitize some tests to stderr output.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Feb 22, 2019
1 parent 8a481c8 commit 0237fa9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_logs_unhandled_exception(self):
# The backtrace should be omitted when --print-exception-stacktrace=False.
print_exception_stacktrace=False)
self.assert_failure(pants_run)
assertRegex(self, pants_run.stderr_data, """\\A\
assertRegex(self, pants_run.stderr_data, """\
timestamp: ([^\n]+)
Exception caught: \\(pants\\.build_graph\\.address_lookup_error\\.AddressLookupError\\) \\(backtrace omitted\\)
Exception message: Build graph construction failed: ExecutionError 1 Exception encountered:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _list_target_check_warnings_sources(self, target_name):
". Unmatched globs were: " +
"[{}]".format(', '.join('"{}"'.format(os.path.join(self._SOURCES_TARGET_BASE, g)) for g in expected_globs)) +
".\n\n")
self.assertEqual(warning_msg, pants_run.stderr_data)
self.assertIn(warning_msg, pants_run.stderr_data)

_ERR_TARGETS = {
'testprojects/src/python/sources:some-missing-some-not': [
Expand Down
8 changes: 0 additions & 8 deletions tests/python/pants_test/rules/test_test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ def run_passing_pants_test(self, trailing_args):
] + trailing_args

pants_run = self.run_pants(args)

self.assert_success(pants_run)
self.assertEqual("", pants_run.stderr_data)
self.assertEqual(pants_run.returncode, 0)

return pants_run

def run_failing_pants_test(self, trailing_args):
Expand All @@ -55,11 +51,7 @@ def run_failing_pants_test(self, trailing_args):
] + trailing_args

pants_run = self.run_pants(args)

self.assert_failure(pants_run)
self.assertEqual("", pants_run.stderr_data)
self.assertEqual(pants_run.returncode, 1)

return pants_run

def test_passing_python_test(self):
Expand Down

0 comments on commit 0237fa9

Please sign in to comment.