Przeglądaj źródła

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 lat temu
rodzic
commit
98a7e17dc1
1 zmienionych plików z 6 dodań i 2 usunięć
  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))