summaryrefslogtreecommitdiff
path: root/test/conftest.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-04-04 19:08:18 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-04-04 19:08:18 -0400
commitf30e35babc63f5613537bb62aef6acb26dadd503 (patch)
tree118c4a736c69167a1bc4057045a7e9fbda8a315e /test/conftest.py
parentecd7b31d5eaed138e699293719f70260da3c978d (diff)
downloadsqlalchemy-f30e35babc63f5613537bb62aef6acb26dadd503.tar.gz
- Fixed the pathing used when tests run; for sqla_nose.py and py.test,
the "./lib" prefix is again inserted at the head of sys.path but only if sys.flags.no_user_site isn't set; this makes it act just like the way Python puts "." in the current path by default. For tox, we are setting the PYTHONNOUSERSITE flag now. fixes #3356
Diffstat (limited to 'test/conftest.py')
-rwxr-xr-xtest/conftest.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/conftest.py b/test/conftest.py
index 590b35700..36dfaa792 100755
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -9,10 +9,12 @@ installs SQLAlchemy's testing plugin into the local environment.
import sys
import os
-for pth in ['../lib']:
- sys.path.append(
- os.path.join(os.path.dirname(os.path.abspath(__file__)), pth))
-
+if not sys.flags.no_user_site:
+ sys.path.insert(
+ 0,
+ os.path.join(
+ os.path.dirname(os.path.abspath(__file__)), '..', 'lib')
+ )
# use bootstrapping so that test plugins are loaded
# without touching the main library before coverage starts