Skip to content

Commit

Permalink
tests: Remove Parentheses From pytest.fixture
Browse files Browse the repository at this point in the history
Without arguments, parentheses are optional. Remove them to fix ruff
PT001 findings.
  • Loading branch information
holesch committed Aug 15, 2024
1 parent 97295c7 commit 21e808e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -284,7 +284,7 @@ def add_time(self, time):
self._now += time


@pytest.fixture()
@pytest.fixture
def http_client():
return http.Client(proxies={})

Expand Down
2 changes: 1 addition & 1 deletion tests/test_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
DEFAULT_AGENT_IP = "6.1.1.1"


@pytest.fixture()
@pytest.fixture
def hub():
return hubmodule.Hub()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 21e808e

Please sign in to comment.