-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Move tests out of kajiki package
This fixes #64.
- Loading branch information
1 parent
494f458
commit fe97577
Showing
19 changed files
with
28 additions
and
3 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
Empty file.
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,25 @@ | ||
import importlib | ||
import pathlib | ||
import sys | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="session", autouse=True) | ||
def add_test_data_module(): | ||
here = pathlib.Path(__file__).parent | ||
data_package = here / "data" / "__init__.py" | ||
spec = importlib.util.spec_from_file_location("kajiki_test_data", str(data_package)) | ||
|
||
# TODO(Python3.4): below dance can change to | ||
# importlib.util.module_from_spec() when support for Python 3.4 is | ||
# dropped. | ||
module = type(sys)(spec.name) | ||
module.__name__ = spec.name | ||
module.__loader__ = spec.loader | ||
module.__package__ = spec.parent | ||
module.__path__ = spec.submodule_search_locations | ||
module.__file__ = spec.origin | ||
|
||
sys.modules[spec.name] = module | ||
spec.loader.exec_module(module) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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