Переглянути джерело

grass.gunittest: CalledModuleError constructor accepts module, code, returncode, and errors (#1788)

Fix order of parameters for CalledModuleError (which is different from CalledProcessError).
Huidae Cho 3 роки тому
батько
коміт
9f853f0d3a
2 змінених файлів з 2 додано та 2 видалено
  1. 1 1
      python/grass/gunittest/case.py
  2. 1 1
      python/grass/gunittest/gmodules.py

+ 1 - 1
python/grass/gunittest/case.py

@@ -1343,7 +1343,7 @@ class TestCase(unittest.TestCase):
                 errors += call_module("g.list", type="vector")
             # TODO: message format, parameters
             raise CalledModuleError(
-                module.returncode, module.name, module.get_python(), errors=errors
+                module.name, module.get_python(), module.returncode, errors=errors
             )
         # TODO: use this also in assert and apply when appropriate
         if expecting_stdout and not module.outputs.stdout.strip():

+ 1 - 1
python/grass/gunittest/gmodules.py

@@ -137,5 +137,5 @@ def call_module(
     output, errors = process.communicate(input=encode(decode(stdin)) if stdin else None)
     returncode = process.poll()
     if returncode:
-        raise CalledModuleError(returncode, module, kwargs, errors)
+        raise CalledModuleError(module, kwargs, returncode, errors)
     return decode(output) if output else None