mirror of
https://github.com/sprockets/sprockets.clients.dynamodb.git
synced 2024-11-23 11:19:54 +00:00
tests: Read environment file if it exists.
This commit is contained in:
parent
aadb8f7a10
commit
96b29a5288
1 changed files with 16 additions and 0 deletions
16
tests/__init__.py
Normal file
16
tests/__init__.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import os
|
||||
|
||||
|
||||
def setup_module():
|
||||
try:
|
||||
with open('build/test-environment') as env_file:
|
||||
for line in env_file:
|
||||
if line.startswith('export '):
|
||||
line = line[7:]
|
||||
name, sep, value = line.strip().partition('=')
|
||||
if value:
|
||||
os.environ[name] = value
|
||||
else:
|
||||
os.environ.pop(name, None)
|
||||
except IOError:
|
||||
pass
|
Loading…
Reference in a new issue