[GRASS-dev] Use 'from=' parameter in python script

Nikos Alexandris nik at nikosalexandris.net
Thu Mar 22 02:36:05 PDT 2018


[all deleted]

In the same script,

```
import grass.script as g
from grass.gunittest.case import TestCase
```

and

```
rescale_output = g.read_command('r.rescale', overwrite=True, verbose=True,
        input=band, output=output_map_name, to=to_range)
print rescale_output

cls.runModule('r.rescale', overwrite=True, verbose=True,
        input=band, output=output_map_name, to=to_range)
```

the former will print the output of `r.rescale`, the latter will not.


Is there a way to get the output of `runModule`, while building a test suite?
And avoid using a `grass.script` function?

Is the purpose of `expecting_stdout=False` in `runModule()` to test if a
module emits something to stdout? [0]

Thanks, Nikos

[0] https://grass.osgeo.org/grass74/manuals/libpython/_modules/gunittest/case.html#TestCase.runModule.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180322/44d1de7f/attachment.sig>


More information about the grass-dev mailing list