summaryrefslogtreecommitdiff
path: root/test/testenv.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-01-12 22:03:42 +0000
committerJason Kirtland <jek@discorporate.us>2008-01-12 22:03:42 +0000
commit17d3c8764e020379e54053bca0b0a2bc71d48aa0 (patch)
tree0b46f1ddc57292b8f5bfbc28ab1679230f63e426 /test/testenv.py
parentc194962019d1bc7322e20b82c33aa1bab3bc2a28 (diff)
downloadsqlalchemy-17d3c8764e020379e54053bca0b0a2bc71d48aa0.tar.gz
- testbase is gone, replaced by testenv
- Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase - testing.db has the configured db - Fixed up the perf/* scripts
Diffstat (limited to 'test/testenv.py')
-rw-r--r--test/testenv.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/testenv.py b/test/testenv.py
new file mode 100644
index 000000000..bdfd6efc0
--- /dev/null
+++ b/test/testenv.py
@@ -0,0 +1,30 @@
+"""First import for all test cases, sets sys.path and loads configuration."""
+
+import sys, os, logging
+from testlib.testing import main
+import testlib.config
+
+
+_setup = False
+
+def configure_for_tests():
+ """import testenv; testenv.configure_for_tests()"""
+
+ global _setup
+ if not _setup:
+ sys.path.insert(0, os.path.join(os.getcwd(), 'lib'))
+ logging.basicConfig()
+
+ testlib.config.configure()
+ _setup = True
+
+def simple_setup():
+ """import testenv; testenv.simple_setup()"""
+
+ global _setup
+ if not _setup:
+ sys.path.insert(0, os.path.join(os.getcwd(), 'lib'))
+ logging.basicConfig()
+
+ testlib.config.configure_defaults()
+ _setup = True