mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
remove monkeypatch
it's interacting strangely with our os.environ stuff and not restoring nicely, probably due to fixture order which is hard to visualise and control.
This commit is contained in:
@@ -130,14 +130,12 @@ def os_environ():
|
||||
"""
|
||||
# for use whenever you expect code to edit environment variables
|
||||
old_env = os.environ.copy()
|
||||
|
||||
class EnvironDict(dict):
|
||||
def __setitem__(self, key, value):
|
||||
assert type(value) == str
|
||||
super().__setitem__(key, value)
|
||||
|
||||
os.environ.clear()
|
||||
|
||||
yield
|
||||
|
||||
# clear afterwards in case anything extra was added to the environment during the test
|
||||
os.environ.clear()
|
||||
for k, v in old_env.items():
|
||||
os.environ[k] = v
|
||||
|
||||
|
||||
Reference in New Issue
Block a user