tests: Read environment file if it exists.

This commit is contained in:
Dave Shawley 2016-05-25 21:27:51 -04:00
parent aadb8f7a10
commit 96b29a5288

16
tests/__init__.py Normal file
View 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