Skip to content

Commit

Permalink
fix: Move an import which is dependent on the OS but only runs when t…
Browse files Browse the repository at this point in the history
…esting into the test util function (#675)
  • Loading branch information
nhoening committed May 9, 2023
1 parent be8a88e commit 47248d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .vscode/spellright.dict
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,4 @@ Changelog
Bugfixes
Dockerfile
nt
12 changes: 7 additions & 5 deletions flexmeasures/data/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import click

if os.name == "nt":
from rq_win import WindowsWorker as SimpleWorker
else:
from rq import SimpleWorker


def work_on_rq(redis_queue, exc_handler=None):

# we only want this import distinction to matter when we actually are testing
if os.name == "nt":
from rq_win import WindowsWorker as SimpleWorker
else:
from rq import SimpleWorker

exc_handlers = []
if exc_handler is not None:
exc_handlers.append(exc_handler)
Expand Down

0 comments on commit 47248d1

Please sign in to comment.