Skip to content

Commit

Permalink
fix: cancel the time in a test
Browse files Browse the repository at this point in the history
  • Loading branch information
martynia authored and fstagni committed Oct 31, 2023
1 parent f001df0 commit 3308bbe
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Pilot/tests/Test_simplePilotLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import tempfile

try:
from Pilot.pilotTools import CommandBase, PilotParams
from Pilot.pilotTools import CommandBase, PilotParams, RemoteLogger
except ImportError:
from pilotTools import CommandBase, PilotParams
from pilotTools import CommandBase, PilotParams, RemoteLogger

import unittest

Expand Down Expand Up @@ -144,7 +144,14 @@ def test_executeAndGetOutput(self, popenMock, argvmock):
self.stderr_mock.write("Errare humanum est!")
self.stderr_mock.seek(0)
pp = PilotParams()
cBase = CommandBase(pp)
try:
cBase = CommandBase(pp)
# we have a logger URL set, so:
assert isinstance(cBase.log, RemoteLogger)
finally:
# and cancel the timer !
cBase.log.buffer.cancelTimer()

popenMock.return_value.stdout = self.stdout_mock
popenMock.return_value.stderr = self.stderr_mock
outData = cBase.executeAndGetOutput("dummy")
Expand Down

0 comments on commit 3308bbe

Please sign in to comment.