forked from zzzeek/sqlalchemy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
- Loading branch information
Showing
11 changed files
with
137 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[run] | ||
include=lib/sqlalchemy/* | ||
|
||
[report] | ||
omit=lib/sqlalchemy/testing/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
""" | ||
Bootstrapper for nose/pytest plugins. | ||
The entire rationale for this system is to get the modules in plugin/ | ||
imported without importing all of the supporting library, so that we can | ||
set up things for testing before coverage starts. | ||
The rationale for all of plugin/ being *in* the supporting library in the | ||
first place is so that the testing and plugin suite is available to other | ||
libraries, mainly external SQLAlchemy and Alembic dialects, to make use | ||
of the same test environment and standard suites available to | ||
SQLAlchemy/Alembic themselves without the need to ship/install a separate | ||
package outside of SQLAlchemy. | ||
NOTE: copied/adapted from SQLAlchemy master for backwards compatibility; | ||
this should be removable when Alembic targets SQLAlchemy 1.0.0. | ||
""" | ||
|
||
import os | ||
import sys | ||
|
||
bootstrap_file = locals()['bootstrap_file'] | ||
to_bootstrap = locals()['to_bootstrap'] | ||
|
||
|
||
def load_file_as_module(name): | ||
path = os.path.join(os.path.dirname(bootstrap_file), "%s.py" % name) | ||
if sys.version_info >= (3, 3): | ||
from importlib import machinery | ||
mod = machinery.SourceFileLoader(name, path).load_module() | ||
else: | ||
import imp | ||
mod = imp.load_source(name, path) | ||
return mod | ||
|
||
if to_bootstrap == "pytest": | ||
sys.modules["sqla_plugin_base"] = load_file_as_module("plugin_base") | ||
sys.modules["sqla_pytestplugin"] = load_file_as_module("pytestplugin") | ||
elif to_bootstrap == "nose": | ||
sys.modules["sqla_plugin_base"] = load_file_as_module("plugin_base") | ||
sys.modules["sqla_noseplugin"] = load_file_as_module("noseplugin") | ||
else: | ||
raise Exception("unknown bootstrap: %s" % to_bootstrap) # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
lib/sqlalchemy/testing/plugin/provision.py → lib/sqlalchemy/testing/provision.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.