-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix plugins test cleanup a of code * Try fixing `test_when_animation_is_cached` test * Lint * Isort * Use ascii_lowercase for random strings * mark test_when_animation_is_cached as xfail * Fix formatting * Use tempdir's for doctest also * Format * isort * yield tmpdir
- Loading branch information
1 parent
7104d71
commit 6e4b02a
Showing
5 changed files
with
147 additions
and
163 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,25 @@ | ||
# This file is automatically picked by pytest | ||
# while running tests. So, that each test is | ||
# run on difference temporary directories and avoiding | ||
# errors. | ||
|
||
# If it is running Doctest the current directory | ||
# is changed because it also tests the config module | ||
# itself. If it's a normal test then it uses the | ||
# tempconfig to change directories. | ||
|
||
import pytest | ||
from _pytest.doctest import DoctestItem | ||
|
||
from manim import config, tempconfig | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def temp_media_dir(tmpdir, monkeypatch, request): | ||
if isinstance(request.node, DoctestItem): | ||
monkeypatch.chdir(tmpdir) | ||
yield tmpdir | ||
else: | ||
with tempconfig({"media_dir": str(tmpdir)}): | ||
assert config.media_dir == str(tmpdir) | ||
yield tmpdir |
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.