[pitivi: 64/65] Set PITIVI_TOP_LEVEL_DIR before the test modules are loaded, not after



commit 3b32852b59fbc13ad644b56c704e05f67d9051eb
Author: Alex BÄluÈ <alexandru balut gmail com>
Date:   Sun Jul 3 23:04:42 2011 +0200

    Set PITIVI_TOP_LEVEL_DIR before the test modules are loaded, not after

 tests/runtests.py |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/tests/runtests.py b/tests/runtests.py
index 2a960c2..6392358 100644
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -9,16 +9,6 @@ def gettestnames(file_names):
 
 loader = unittest.TestLoader()
 
-# Pick which tests to run.
-TEST_CASE = os.getenv("TESTCASE")
-if TEST_CASE:
-    test_names = [TEST_CASE]
-else:
-    test_names = gettestnames(sys.argv[1:])
-suite = loader.loadTestsFromNames(test_names)
-if not list(suite):
-    raise Exception("No tests found")
-
 # Set verbosity.
 descriptions = 1
 verbosity = 1
@@ -33,6 +23,16 @@ dir = os.path.dirname(os.path.abspath(__file__))
 top_srcdir = os.path.split(dir)[0]
 os.environ.setdefault('PITIVI_TOP_LEVEL_DIR', top_srcdir)
 
+# Pick which tests to run.
+TEST_CASE = os.getenv("TESTCASE")
+if TEST_CASE:
+    test_names = [TEST_CASE]
+else:
+    test_names = gettestnames(sys.argv[1:])
+suite = loader.loadTestsFromNames(test_names)
+if not list(suite):
+    raise Exception("No tests found")
+
 # Run the tests.
 testRunner = unittest.TextTestRunner(descriptions=descriptions,
     verbosity=verbosity)



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