generated from linz/template-python-hello-world
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: Pull out function for any epoch datetime * refactor: Pull out test fixture to default location To be able to share between tests. * fix: Add to rather than replacing dictionary key To avoid clobbering existing data.
- Loading branch information
Showing
4 changed files
with
31 additions
and
23 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,17 @@ | ||
from shutil import rmtree | ||
from tempfile import mkdtemp | ||
from typing import Generator | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(name="setup", autouse=True) | ||
def fixture_setup() -> Generator[str, None, None]: | ||
""" | ||
This function creates a temporary directory and deletes it after each test. | ||
See following link for details: | ||
https://docs.pytest.org/en/stable/fixture.html#yield-fixtures-recommended | ||
""" | ||
target = mkdtemp() | ||
yield target | ||
rmtree(target) |
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