Procházet zdrojové kódy

Add cleaners to Makefile

oz123 před 10 roky
rodič
revize
118a5eca3f
2 změnil soubory, kde provedl 10 přidání a 4 odebrání
  1. 4 2
      Makefile
  2. 6 2
      pwman/tests/test_pwman.py

+ 4 - 2
Makefile

@@ -14,7 +14,9 @@ help:
 clean: clean-build clean-pyc
 	rm -fr htmlcov/
 	rm -f test.db
-	rm -f pwman/tests/test-baseui.pwman.db
+	python -c "from pwman.tests.test_base_ui import TestBaseUI; TestBaseUI.clean_all()"
+	python -c "from pwman.tests.test_importer import TestImporter; TestImporter.clean_all()"
+	python -c "from pwman.tests.test_config import TestConfig; TestConfig.clean_all()"
 
 clean-build:
 	rm -fr build/
@@ -29,7 +31,7 @@ clean-pyc:
 lint:
 	flake8 pwman scripts
 
-test: install clean 
+test: install 
 	git checkout pwman/tests/pwman.v0.0.8.db
 	python setup.py test
 

+ 6 - 2
pwman/tests/test_pwman.py

@@ -62,5 +62,9 @@ def suite():
     return suite
 
 if __name__ == '__main__':
-    #unittest.main(verbosity=1, failfast=True)
-    unittest.TextTestRunner(verbosity=2, failfast=True).run(suite())
+    try:
+        unittest.TextTestRunner(verbosity=2, failfast=True).run(suite())
+    except SystemExit:
+        TestConfig.clean_all()
+        TestBaseUI.clean_all()
+        TestImporter.clean_all()