Allow not having a config file, otherwise pytest can't collect tests without it
This commit is contained in:
parent
10ac46b773
commit
f7018e892d
1 changed files with 6 additions and 3 deletions
|
@ -116,9 +116,12 @@ def _load_from_file(file: str = _FILE) -> _Config:
|
|||
Load the state from a file
|
||||
Apply any required migrations
|
||||
"""
|
||||
assert os.path.isfile(file)
|
||||
loaded = files.load(file)
|
||||
_migrate(loaded)
|
||||
loaded = {}
|
||||
if os.path.isfile(file):
|
||||
loaded = files.load(file)
|
||||
_migrate(loaded)
|
||||
else:
|
||||
logger.warn("No %s file found, bot cannot run!", file)
|
||||
return _Config(loaded)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue