Skip to content

Commit

Permalink
Use ternary operator to remove mypy error
Browse files Browse the repository at this point in the history
Otherwise we would get this error:

```
error: Function "Callable[[Any, bool, Optional[float]], None]" could always be true in boolean context  [truthy-function]
```
  • Loading branch information
nicoddemus committed Nov 15, 2022
1 parent 41620d2 commit 4a33933
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions testing/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@ def __str__(self):


class WorkerSetup:
use_callback = False

def __init__(self, request, pytester: pytest.Pytester) -> None:
self.request = request
self.pytester = pytester
self.use_callback = False
self.events = Queue() # type: ignore[var-annotated]

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

class DummyMananger:
testrunuid = uuid.uuid4().hex
Expand Down

0 comments on commit 4a33933

Please sign in to comment.