Skip to content

Commit

Permalink
Importing local settings will now check if pytest is active (#643)
Browse files Browse the repository at this point in the history
When a user undertakes testing, for example in T3, it will import the
users local settings which can be problematic if they are not using one
of the defined ESS. Therefore, the addition of the pytest statement will
then make it so if the user is testing, it will import arcs default
settings and not the local settings.
  • Loading branch information
calvinp0 committed Apr 17, 2023
2 parents 0bb617a + 035bd8d commit 262303c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arc/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import settings as local_settings
except ImportError:
pass
if local_settings:
if local_settings and 'pytest' not in sys.modules:
local_settings_dict = {key: val for key, val in vars(local_settings).items() if '__' not in key}
settings.update(local_settings_dict)
# Set global_ess_settings to None if using a local settings file (ARC's defaults are dummies)
Expand Down

0 comments on commit 262303c

Please sign in to comment.