소스 검색

grass.gunittest: Output both Bash and Python for failed tests (#1805)

When test fails to run a module, both Python and Bash code for the run is printed.
Previously, it was only Python. Having Bash syntax at hand may be more convenient when using command line or GDB to debug the test.
Vaclav Petras 3 년 전
부모
커밋
98a7e17dc1
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      python/grass/gunittest/case.py

+ 6 - 2
python/grass/gunittest/case.py

@@ -1410,10 +1410,14 @@ class TestCase(unittest.TestCase):
             stdmsg = (
                 "Running <{m.name}> module ended"
                 " with non-zero return code ({m.returncode})\n"
-                "Called: {code}\n"
+                "Called (Python): {code}\n"
+                "Called (Bash): {bash}\n"
                 "See the following errors:\n"
                 "{errors}".format(
-                    m=module, code=module.get_python(), errors=module.outputs.stderr
+                    m=module,
+                    code=module.get_python(),
+                    bash=module.get_bash(),
+                    errors=module.outputs.stderr,
                 )
             )
             self.fail(self._formatMessage(msg, stdmsg))