django-configurations/tests/setup_test.py
Michael Käufl 6cb932e47f Run pyupgrade on the code
But don't touch string formatting.

https://pypi.org/project/pyupgrade/
2021-01-19 13:11:16 +06:00

14 lines
313 B
Python

"""Used by tests to ensure logging is kept when calling setup() twice."""
from unittest 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')