-
Notifications
You must be signed in to change notification settings - Fork 866
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
364 additions
and
237 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 |
---|---|---|
|
@@ -6,6 +6,7 @@ dist/ | |
*.egg-info/ | ||
.idea | ||
*htmlcov* | ||
.cache | ||
.coverage | ||
.github/actions/ | ||
.github/.DS_Store | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,34 @@ | ||
import shutil | ||
import sys | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from .models.base_model import save_pt_file | ||
from .test_utils.mock_context import MockContext | ||
|
||
|
||
@pytest.fixture() | ||
def base_model_dir(tmp_path_factory): | ||
model_dir = tmp_path_factory.mktemp("base_model_dir") | ||
|
||
shutil.copyfile( | ||
Path(__file__).parents[0] / "models" / "base_model.py", model_dir / "model.py" | ||
) | ||
|
||
save_pt_file(model_dir.joinpath("model.pt").as_posix()) | ||
|
||
sys.path.append(model_dir.as_posix()) | ||
yield model_dir | ||
sys.path.pop() | ||
|
||
|
||
@pytest.fixture() | ||
def base_model_context(base_model_dir): | ||
|
||
context = MockContext( | ||
model_name="mnist", | ||
model_dir=base_model_dir.as_posix(), | ||
model_file="model.py", | ||
) | ||
yield context |
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 was deleted.
Oops, something went wrong.
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.