Преглед на файлове

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 = (
             stdmsg = (
                 "Running <{m.name}> module ended"
                 "Running <{m.name}> module ended"
                 " with non-zero return code ({m.returncode})\n"
                 " with non-zero return code ({m.returncode})\n"
-                "Called: {code}\n"
+                "Called (Python): {code}\n"
+                "Called (Bash): {bash}\n"
                 "See the following errors:\n"
                 "See the following errors:\n"
                 "{errors}".format(
                 "{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))
             self.fail(self._formatMessage(msg, stdmsg))