Skip to content

Commit

Permalink
only_start
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 committed May 23, 2024
1 parent 9f253cc commit 4212774
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion clickplc/tests/test_driver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Test the driver correctly parses a tags file and responds with correct data."""
import contextlib
import inspect
import os

import pytest
Expand All @@ -22,7 +23,10 @@ async def _sim():
modbus_device = 'device',
json_file = os.path.join('clickplc', 'tests', 'simulator_setup.json')
)
await serverTask.run_forever(only_start=True)
if 'only_start' in inspect.signature(serverTask.run_forever).parameters:
await serverTask.run_forever(only_start=True)
else:
await serverTask.run_forever()
yield
with contextlib.suppress(NameError):
await serverTask.stop()
Expand Down

0 comments on commit 4212774

Please sign in to comment.