Skip to content

Commit 0f7bf45

Browse files
committed
Avoid warnings from pytest
This avoids pytest complaining about a class with a name starting with "Test" that has a __init__ constructor.
1 parent 6fa1106 commit 0f7bf45

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

doc/qrexec-policy-parser.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Miscellaneous and test facilities
163163
:members:
164164
:member-order: bysource
165165

166-
.. autoclass:: TestPolicy
166+
.. autoclass:: MockPolicy
167167
:members:
168168
:member-order: bysource
169169

qrexec/tests/cli.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# pylint: disable=redefined-outer-name
3333

3434

35-
class TestPolicy:
35+
class MockPolicy:
3636
def __init__(self):
3737
self.resolution_type = None
3838
self.targets_for_ask = None
@@ -90,7 +90,7 @@ def policy():
9090
Mock for FilePolicy object that will evaluate the requests.
9191
"""
9292

93-
policy = TestPolicy()
93+
policy = MockPolicy()
9494
with mock.patch("qrexec.policy.parser.FilePolicy") as mock_policy:
9595
mock_policy.return_value = policy
9696
yield policy

qrexec/tests/server.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
asyncio_fixture = pytest.fixture
3939

4040

41-
class TestService(SocketService):
41+
class MockService(SocketService):
4242
async def handle_request(self, params, service, source_domain):
4343
return json.dumps(
4444
{
@@ -62,7 +62,7 @@ def temp_dir():
6262
async def server(temp_dir):
6363
socket_path = os.path.join(temp_dir, "Service")
6464

65-
service = TestService(socket_path)
65+
service = MockService(socket_path)
6666
server = await service.start()
6767

6868
try:

0 commit comments

Comments
 (0)