瀏覽代碼

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))