Skip to content

Commit d11e3e7

Browse files
committed
Additional check whether the test configuration file exists
1 parent 5757df7 commit d11e3e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ def test_config() -> Optional[Dict]:
6262
if 'FLASK_CONFIG' not in os.environ:
6363
LOGGER.info('Missing test configuration via FLASK_CONFIG environment variable. Tests are limited')
6464
return None
65+
config_file = os.path.expanduser(os.environ['FLASK_CONFIG'])
66+
if not os.path.exists(config_file):
67+
LOGGER.info('Configuration set via FLASK_CONFIG environment variable does not exist. Tests are limited')
68+
return None
6569
with open(os.path.expanduser(os.environ['FLASK_CONFIG'])) as C:
6670
return json.load(C)
6771

0 commit comments

Comments
 (0)