Skip to content

Commit

Permalink
Merge pull request #611 from Morg42/develop
Browse files Browse the repository at this point in the history
tests: prevent follow-up errors in log/shtime
  • Loading branch information
Morg42 authored Jan 6, 2024
2 parents 60fadd1 + f14b42b commit ec365e7
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/mock/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,17 @@ def __init__(self):
self.children = []
self._use_modules = 'True'
self._moduledict = {}
if self.shtime is None:
# if self.shtime is None:
# self.shtime = Shtime.get_instance()
self.shtime = Shtime(self)
# self.shtime = Shtime(self)

# prevent instantiating a second logs instance
global logs_instance
try:
self.logs = logs_instance
except NameError:
logs_instance = self.logs = lib.log.Logs(self) # initialize object for memory logs and extended log levels for plugins

self.logs = lib.log.Logs(self) # initialize object for memory logs and extended log levels for plugins

#############################################################
# setup logging
Expand All @@ -148,8 +154,11 @@ def __init__(self):

self.scheduler = MockScheduler()

if self.shtime is None:
# make sure not to instantiate a second shtime
if lib.shtime._shtime_instance is None:
lib.shtime._shtime_instance = self.shtime = Shtime(self)
else:
self.shtime = Shtime.get_instance()
# Start()
# self.scheduler = lib.scheduler.Scheduler(self)
if self.modules is None:
Expand Down

0 comments on commit ec365e7

Please sign in to comment.