Skip to content

Commit 4a33933

Browse files
committed
Use ternary operator to remove mypy error
Otherwise we would get this error: ``` error: Function "Callable[[Any, bool, Optional[float]], None]" could always be true in boolean context [truthy-function] ```
1 parent 41620d2 commit 4a33933

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

testing/test_remote.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,18 @@ def __str__(self):
2929

3030

3131
class WorkerSetup:
32-
use_callback = False
33-
3432
def __init__(self, request, pytester: pytest.Pytester) -> None:
3533
self.request = request
3634
self.pytester = pytester
35+
self.use_callback = False
3736
self.events = Queue() # type: ignore[var-annotated]
3837

3938
def setup(self) -> None:
4039
self.pytester.chdir()
4140
# import os ; os.environ['EXECNET_DEBUG'] = "2"
4241
self.gateway = execnet.makegateway()
4342
self.config = config = self.pytester.parseconfigure()
44-
putevent = self.use_callback and self.events.put or None
43+
putevent = self.events.put if self.use_callback else None
4544

4645
class DummyMananger:
4746
testrunuid = uuid.uuid4().hex

0 commit comments

Comments
 (0)