summaryrefslogtreecommitdiff
path: root/test/conftest.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-09-14 21:41:13 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-09-14 21:41:13 -0400
commitd7498cf4adb8ef9f35d1efa6dc747ac9eb489e60 (patch)
treede69b7ec88fef69c36704d2a7b06b1a0ffe0f17b /test/conftest.py
parent7fd3f05805a7cf1ff1fa29ffcf375c4eea6627ba (diff)
downloadsqlalchemy-d7498cf4adb8ef9f35d1efa6dc747ac9eb489e60.tar.gz
- remove some crufty old testing options
- reestablish the "bootstrap" system of loading the test runners in testing/plugin; using the updated approach we just came up with for alembic. Coverage should be fixed now when running either py.test or nose. fixes #3196 - upgrade tox.ini and start using a .coveragerc file
Diffstat (limited to 'test/conftest.py')
-rwxr-xr-xtest/conftest.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/test/conftest.py b/test/conftest.py
index 1dd442309..c697085ee 100755
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -7,9 +7,23 @@ installs SQLAlchemy's testing plugin into the local environment.
"""
import sys
+import os
-from os import path
for pth in ['../lib']:
- sys.path.insert(0, path.join(path.dirname(path.abspath(__file__)), pth))
+ sys.path.insert(
+ 0,
+ os.path.join(os.path.dirname(os.path.abspath(__file__)), pth))
-from sqlalchemy.testing.plugin.pytestplugin import *
+
+# use bootstrapping so that test plugins are loaded
+# without touching the main library before coverage starts
+bootstrap_file = os.path.join(
+ os.path.dirname(__file__), "..", "lib", "sqlalchemy",
+ "testing", "plugin", "bootstrap.py"
+)
+
+with open(bootstrap_file) as f:
+ code = compile(f.read(), "bootstrap.py", 'exec')
+ to_bootstrap = "pytest"
+ exec(code, globals(), locals())
+ from pytestplugin import * # noqa