[GRASS-dev] testsuite problems (t.connect)

Vaclav Petras wenzeslaus at gmail.com
Thu Feb 18 06:44:01 PST 2016


On Thu, Feb 18, 2016 at 5:45 AM, Luca Delucchi <lucadeluge at gmail.com> wrote:

> I think this annoing problem (to use again GRASS I have to exit and
> start GRASS) appear because in the setUpClass function a new mapset is
> created and used but in tearDownClass function the old mapset isn't
> set back and the new mapset is removed.
>
> I tried to fix this problem but I'm not able to store the old mapset
> somewhere and use it in the tearDownClass (self doesn't work because
> @classmethod decorator). Do you have any idea to solve this?
>

The classmethods don't have self but they have cls. These are the variables
you can set in the body of the class, e.g. mapsets_to_remove in the
test_distr_tgis_db_raster3d.py test [1]. You can assign the value in the
setUpClass method and use it in tearDownClass through the cls reference,
e.g. cls.mapsets_to_remove.append(mapset_name).

[1]
https://trac.osgeo.org/grass/browser/grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py?rev=67878#L19
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20160218/d547e028/attachment-0001.html>


More information about the grass-dev mailing list