Files
sqlalchemy/test/conftest.py
T
Mike Bayer d7498cf4ad - 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
2014-09-14 21:41:13 -04:00

30 lines
745 B
Python
Executable File

#!/usr/bin/env python
"""
pytest plugin script.
This script is an extension to py.test which
installs SQLAlchemy's testing plugin into the local environment.
"""
import sys
import os
for pth in ['../lib']:
sys.path.insert(
0,
os.path.join(os.path.dirname(os.path.abspath(__file__)), pth))
# 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