diff --git a/tests/test_agent.py b/tests/test_agent.py index d39d8c9..7603a8c 100644 --- a/tests/test_agent.py +++ b/tests/test_agent.py @@ -209,7 +209,7 @@ async def port_forward(self, ready_event, proxy, target, local_port): del self.port_forwards[local_port] -@pytest.fixture() +@pytest.fixture async def agent_io(): io = FakeAgentIO() async with agentmodule.Agent(HUB_URL, io, None) as agent: diff --git a/tests/test_auth.py b/tests/test_auth.py index 3f560c5..f8600db 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -179,12 +179,12 @@ async def send(self, data): await self._send(data) -@pytest.fixture() +@pytest.fixture def http_client(): return FakeHttpClient() -@pytest.fixture() +@pytest.fixture def hub(http_client): config = { "auth": { @@ -201,7 +201,7 @@ def hub(http_client): return hubmodule.Hub(config, http_client) -@pytest.fixture() +@pytest.fixture def token_store_path(): path = pathlib.Path(__file__).parent / "auth_tokens.json" path.unlink(missing_ok=True) @@ -352,7 +352,7 @@ async def test_permission_lost(hub, http_client, token_store_path, fake_time): assert "Permission lost" in str(execinfo.value) -@pytest.fixture() +@pytest.fixture def fake_time(monkeypatch): fake_time_ = FakeTime() fake_datetime = fake_time_.fake_datetime() diff --git a/tests/test_http.py b/tests/test_http.py index 2d2bca8..6f5db47 100644 --- a/tests/test_http.py +++ b/tests/test_http.py @@ -179,7 +179,7 @@ async def get_written(self): return await self._queue.get() -@pytest.fixture() +@pytest.fixture def fake_server(monkeypatch): fake_server_ = FakeServer() monkeypatch.setattr(util, "connect", fake_server_.connect) @@ -256,7 +256,7 @@ def _send(self, conn, events): self._reader.feed(data) -@pytest.fixture() +@pytest.fixture def fake_time(monkeypatch): fake_time_ = FakeTime() fake_datetime = fake_time_.fake_datetime() @@ -284,7 +284,7 @@ def add_time(self, time): self._now += time -@pytest.fixture() +@pytest.fixture def http_client(): return http.Client(proxies={}) diff --git a/tests/test_hub.py b/tests/test_hub.py index 8a41f38..fe75332 100644 --- a/tests/test_hub.py +++ b/tests/test_hub.py @@ -13,7 +13,7 @@ DEFAULT_AGENT_IP = "6.1.1.1" -@pytest.fixture() +@pytest.fixture def hub(): return hubmodule.Hub() diff --git a/tests/test_jsonrpc.py b/tests/test_jsonrpc.py index 63d51d0..0ebabb1 100644 --- a/tests/test_jsonrpc.py +++ b/tests/test_jsonrpc.py @@ -73,7 +73,7 @@ def is_empty(self): Fakes = collections.namedtuple("Fakes", ["channel", "api", "transport"]) -@pytest.fixture() +@pytest.fixture async def fakes(): transport = FakeTransport() api = FakeApi()