浏览代码

Cite from Vaclav: it is a good idea to write tear down just after set up

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61193 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 11 年之前
父节点
当前提交
f12e05bca8
共有 2 个文件被更改,包括 12 次插入11 次删除
  1. 6 5
      raster/r.gwflow/testsuite/validation_7x7_grid.py
  2. 6 6
      raster/r.gwflow/testsuite/validation_excavation.py

+ 6 - 5
raster/r.gwflow/testsuite/validation_7x7_grid.py

@@ -18,6 +18,12 @@ class Validation7x7Grid(TestCase):
         grass.use_temp_region()
         cls.runModule("g.region", res=100, n=700, s=0, w=0, e=700)
 
+    @classmethod
+    def tearDownClass(cls):
+        """!Remove the temporary region
+        """
+        grass.del_temp_region()
+
     def setUp(self):
         """Set region and create input data for transient groundwater flow computation
         """
@@ -76,11 +82,6 @@ class Validation7x7Grid(TestCase):
         self.assertRasterFitsUnivar(raster="gwresult_conf",  reference=univar_string,  precision=3)
         self.assertRasterFitsInfo(raster="gwresult_conf",  reference=info_string,  precision=3)
 
-    @classmethod
-    def tearDownClass(cls):
-        """!Remove the temporary region
-        """
-        grass.del_temp_region()
 
 if __name__ == '__main__':
     from gunittest.main import test

+ 6 - 6
raster/r.gwflow/testsuite/validation_excavation.py

@@ -19,6 +19,12 @@ class ValidationExcavation(TestCase):
         grass.use_temp_region()
         cls.runModule("g.region", flags="p",  res=50, n=950, s=0, w=0, e=2000)
 
+    @classmethod
+    def tearDownClass(cls):
+        """!Remove the temporary region
+        """
+        grass.del_temp_region()
+
     def setUp(self):
         """Set region and create input data for steady state groundwater flow computation
         """
@@ -75,12 +81,6 @@ class ValidationExcavation(TestCase):
         self.assertRasterFitsUnivar(raster="gwresult",  reference=univar_string,  precision=3)
         self.assertRasterFitsInfo(raster="gwresult",  reference=info_string,  precision=3)
 
-    @classmethod
-    def tearDownClass(cls):
-        """!Remove the temporary region
-        """
-        grass.del_temp_region()
-
 if __name__ == '__main__':
     from gunittest.main import test
     test()