This repository has been archived by the owner on Jan 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #157: catch pydoc.ErrorDuringImport
- Loading branch information
1 parent
e03ccdc
commit dd27835
Showing
2 changed files
with
11 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import os | ||
import shutil | ||
from functools import partial | ||
|
||
import pytest | ||
from django.conf import settings | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def create_test_directories(): | ||
paths = (settings.STATICFILES_DIRS[0], settings.STATIC_ROOT) | ||
map(partial(os.makedirs, exist_ok=True), paths) | ||
paths = (settings.STATICFILES_DIRS[0], settings.STATIC_ROOT, settings.MEDIA_ROOT) | ||
for path in paths: | ||
if not os.path.exists(path): | ||
os.makedirs(path) | ||
try: | ||
yield | ||
finally: | ||
map(shutil.rmtree, paths) | ||
for path in paths: | ||
shutil.rmtree(path) |