-
Notifications
You must be signed in to change notification settings - Fork 4
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
9 changed files
with
5,357 additions
and
42 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
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
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,37 @@ | ||
import logging | ||
from pathlib import Path | ||
from unittest.mock import MagicMock | ||
|
||
import pytest | ||
from _pytest._py.path import LocalPath | ||
|
||
# derived from https://github.com/elifesciences/sciencebeam-trainer-delft/tree/develop/tests | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
@pytest.fixture(scope='session', autouse=True) | ||
def setup_logging(): | ||
logging.root.handlers = [] | ||
logging.basicConfig(level='INFO') | ||
logging.getLogger('tests').setLevel('DEBUG') | ||
# logging.getLogger('sciencebeam_trainer_delft').setLevel('DEBUG') | ||
|
||
|
||
def _backport_assert_called(mock: MagicMock): | ||
assert mock.called | ||
|
||
|
||
@pytest.fixture(scope='session', autouse=True) | ||
def patch_magicmock(): | ||
try: | ||
MagicMock.assert_called | ||
except AttributeError: | ||
MagicMock.assert_called = _backport_assert_called | ||
|
||
|
||
@pytest.fixture | ||
def temp_dir(tmpdir: LocalPath): | ||
# convert to standard Path | ||
return Path(str(tmpdir)) | ||
|
Oops, something went wrong.