mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-27 02:52:53 -04:00
f30e35babc
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
34 lines
806 B
Python
Executable File
34 lines
806 B
Python
Executable File
#!/usr/bin/env python
|
|
"""
|
|
nose runner script.
|
|
|
|
This script is a front-end to "nosetests" which
|
|
installs SQLAlchemy's testing plugin into the local environment.
|
|
|
|
"""
|
|
import sys
|
|
import nose
|
|
import os
|
|
|
|
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
|
|
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 = "nose"
|
|
exec(code, globals(), locals())
|
|
|
|
|
|
from noseplugin import NoseSQLAlchemy
|
|
nose.main(addplugins=[NoseSQLAlchemy()])
|