"""
pytest plugin script.
This script is an extension to pytest which
installs SQLAlchemy's testing plugin into the local environment.
"""
import os
import sys
import pytest
os.environ["SQLALCHEMY_WARN_20"] = "true"
collect_ignore_glob = []
pytest.register_assert_rewrite("sqlalchemy.testing.assertions")
if not sys.flags.no_user_site:
sys.path.insert(
0,
os.path.abspath(
os.path.join(
os.path.dirname(os.path.abspath(__file__)), "..", "lib"
)
),
)
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 sqla_pytestplugin import *