Skip to content

Commit

Permalink
Add a reset method to Config, fixes nv-morpheus#68
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Jan 26, 2022
1 parent 20c6b41 commit 9e1f213
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions morpheus/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,9 @@ def to_string(self):

# Using JSON serializer for now since its easier to read. pprint is more compact
return json.dumps(dataclasses.asdict(self), indent=2, sort_keys=True)

@classmethod
def reset(cls):
cls.__default = None
cls.__instance = None
cls.__is_creating = False
5 changes: 2 additions & 3 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ def setUp(self) -> None:
self._mock_triton_servers_dir = MOCK_TRITON_DIR

def tearDown(self) -> None:
# reset the config singleton work-around for #68
Config._Config__default = None
Config._Config__instance = None
# reset the config singleton
Config.reset()

# Reset the asyncio event loop work-around for #69
loop = asyncio.get_event_loop()
Expand Down

0 comments on commit 9e1f213

Please sign in to comment.