[GRASS-dev] Running python test: why are they not running?

Vaclav Petras wenzeslaus at gmail.com
Thu Aug 20 06:52:26 PDT 2015


On Wed, Aug 19, 2015 at 11:02 AM, Rainer M Krug <Rainer at krugs.de> wrote:

> Hi
>
> I am working on the homebrew script for OS X and am trying to implement
> the tests. I download the test dataset, extract it, and run
>
> --8<---------------cut here---------------start------------->8---
> grass71 ./nc_basic_spm_grass7/PERMANENT --exec python -m
> grass.gunittest.main --location './nc_basic_spm_grass7' --location-type nc
> --8<---------------cut here---------------end--------------->8---
>
> But I get the following:
>
> ,----
> | ==> tar xzf ./nc_basic_spm_grass7.tar.gz
> | ==> ls -l ./nc_basic_spm_grass7/
> | total 24
> | -rw-r--r--   1 rainerkrug  wheel  1035 Nov  3  2008 CREDITS.txt
> | -rw-r--r--   1 rainerkrug  wheel  2710 Jul 25  2013 HISTORY.txt
> | drwxr-xr-x  18 rainerkrug  wheel   612 Feb 13  2013 PERMANENT
> | -rw-r--r--   1 rainerkrug  wheel   130 Nov 26  2012 VERSION.txt
> | drwxr-xr--  16 rainerkrug  wheel   544 Jul 25  2013 user1
> | ==> grass71 ./nc_basic_spm_grass7/PERMANENT --exec python -m
> grass.gunittest.main --location './nc_basic_spm_grass7' --location-type nc
> | WARNING: Default locale settings are missing. GRASS running with C
> locale.
> | Starting GRASS GIS...
> | Executing <python -m grass.gunittest.main --location
> ./nc_basic_spm_grass7 --location-type nc> ...
> |
> | Executed 0 test files in 0:00:00.046629.
> | From them 0 files (unknown percentage) were successful and 0 files
> (unknown percentage) failed.
> | Execution of <python -m grass.gunittest.main --location
> ./nc_basic_spm_grass7 --location-type nc> finished.
> | Cleaning up temporary files...
> | 04:57:47 ~$
> `----
>
> If I run the same command in my home directory, where the dataset is
> also installed, the tests run as expected.
>
> Any suggestions why the tests do not run?
>
> The data is downloaded, and extracted (see the ls -l above).
>
> Any suggestions?
>

Do you run it from the directory with the source code? The tests are only
in the source code. `python -m grass.gunittest.main` will find all tests in
all subdirectories of the current directory.

Vaclav

https://grass.osgeo.org/grass71/manuals/libpython/gunittest_testing.html#testing-with-gunittest-package-in-general
https://grass.osgeo.org/grass71/manuals/libpython/gunittest_running_tests.html#running-tests-report


> Thanks,
>
> Rainer
>
>
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
>
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
>
> Tel :       +33 - (0)9 53 10 27 44
> Cell:       +33 - (0)6 85 62 59 98
> Fax :       +33 - (0)9 58 10 27 44
>
> Fax (D):    +49 - (0)3 21 21 25 22 44
>
> email:      Rainer at krugs.de
>
> Skype:      RMkrug
>
> PGP: 0x0F52F982
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150820/9e30e4b8/attachment.html>


More information about the grass-dev mailing list