MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / fail_with_message

Method fail_with_message

tests_python/debugger_unittest.py:662–697  ·  view source on GitHub ↗
(self, msg, stdout, stderr, writerThread)

Source from the content-addressed store, hash-verified

660 return log_contents
661
662 def fail_with_message(self, msg, stdout, stderr, writerThread):
663 log_contents = self.get_log_contents()
664 msg += (
665 "\n\n===========================\nStdout: \n"
666 + "".join(stdout)
667 + "\n\n===========================\nStderr:"
668 + "".join(stderr)
669 + "\n\n===========================\nWriter Log:\n"
670 + "\n".join(getattr(writerThread, "log", []))
671 + "\n\n===========================\nLog:"
672 + log_contents
673 )
674
675 if IS_JYTHON:
676 # It seems we have some spurious errors which make Jython tests flaky (on a test run it's
677 # not unusual for one test among all the tests to fail with this error on Jython).
678 # The usual traceback in this case is:
679 #
680 # Traceback (most recent call last):
681 # File "/home/travis/build/fabioz/PyDev.Debugger/_pydevd_bundle/pydevd_comm.py", line 287, in _on_run
682 # line = self._read_line()
683 # File "/home/travis/build/fabioz/PyDev.Debugger/_pydevd_bundle/pydevd_comm.py", line 270, in _read_line
684 # r = self.sock.recv(1024)
685 # File "/home/travis/build/fabioz/PyDev.Debugger/_pydevd_bundle/pydevd_comm.py", line 270, in _read_line
686 # r = self.sock.recv(1024)
687 # File "/home/travis/jython/Lib/_socket.py", line 1270, in recv
688 # data, _ = self._get_message(bufsize, "recv")
689 # File "/home/travis/jython/Lib/_socket.py", line 384, in handle_exception
690 # raise _map_exception(jlx)
691 # error: [Errno -1] Unmapped exception: java.lang.NullPointerException
692 #
693 # So, ignore errors in this situation.
694
695 if "error: [Errno -1] Unmapped exception: java.lang.NullPointerException" in msg:
696 raise IgnoreFailureError()
697 raise AssertionError(msg)
698
699
700# =======================================================================================================================

Callers 1

run_processMethod · 0.95

Calls 3

get_log_contentsMethod · 0.95
IgnoreFailureErrorClass · 0.85
joinMethod · 0.45

Tested by

no test coverage detected