[pitivi] tests: run test_integration only if TEST_INTEGRATION is set.



commit acd62daf909bacb956090e215547a84208507e41
Author: Alessandro Decina <alessandro decina collabora co uk>
Date:   Tue Aug 10 16:04:41 2010 +0200

    tests: run test_integration only if TEST_INTEGRATION is set.
    
    Allows me to use trial and nose to run the tests without test_integration
    failing.

 tests/Makefile.am         |    2 +-
 tests/test_integration.py |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0fb912c..7670ee2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -25,5 +25,5 @@ check-local:
 	@PYTHONPATH=$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(srcdir)/runtests.py $*
 
 check-integration:
-	@PYTHONPATH=$(top_srcdir):$(PYTHONPATH) $(PYTHON)\
+	@PYTHONPATH=$(top_srcdir):$(PYTHONPATH) TEST_INTEGRATION=1 $(PYTHON)\
         $(srcdir)/test_integration.py
diff --git a/tests/test_integration.py b/tests/test_integration.py
index 64206a9..5b833c8 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -1077,5 +1077,17 @@ class TestTransitions(Base):
     def testSaveAndLoadWithTransitions(self):
         pass
 
+# Readable code ends here <-
+
+if not os.getenv("TEST_INTEGRATION"):
+    import inspect
+
+    for symbol_name in list(globals().keys()):
+        print symbol_name
+        symbol = globals()[symbol_name]
+        if inspect.isclass(symbol) and symbol.__name__.startswith('Test') \
+                and symbol.__module__ == __name__:
+            del globals()[symbol_name]
+
 if __name__ == "__main__":
     unittest.main()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]