On Thu, Feb 18, 2016 at 5:45 AM, Luca Delucchi <[email protected]> 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
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to