-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from blueyed/setup-once
_setup: do not call django.setup() if settings are configured already
- Loading branch information
Showing
6 changed files
with
46 additions
and
5 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.coverage.* | ||
.coverage | ||
coverage.xml | ||
sitecustomize.py | ||
docs/_build | ||
*.egg-info | ||
*.egg | ||
|
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"""Setup coverage tracking for subprocesses. | ||
Any ImportError is silently ignored. | ||
Requires COVERAGE_PROCESS_START in the environments, which gets set in | ||
tox.ini. | ||
""" | ||
import coverage | ||
|
||
coverage.process_startup() |
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 @@ | ||
"""Used by tests to ensure logging is kept when calling setup() twice.""" | ||
|
||
try: | ||
from unittest import mock | ||
except ImportError: | ||
from mock import mock | ||
|
||
import configurations | ||
|
||
print('setup_1') | ||
configurations.setup() | ||
|
||
with mock.patch('django.setup', side_effect=Exception('setup called twice')): | ||
print('setup_2') | ||
configurations.setup() | ||
|
||
print('setup_done') |
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