Skip to content

Commit

Permalink
Avoid warnings from pytest
Browse files Browse the repository at this point in the history
This avoids pytest complaining about a class with a name starting with
"Test" that has a __init__ constructor.
  • Loading branch information
DemiMarie committed Apr 28, 2024
1 parent 6fa1106 commit 0f7bf45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/qrexec-policy-parser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Miscellaneous and test facilities
:members:
:member-order: bysource

.. autoclass:: TestPolicy
.. autoclass:: MockPolicy
:members:
:member-order: bysource

Expand Down
4 changes: 2 additions & 2 deletions qrexec/tests/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# pylint: disable=redefined-outer-name


class TestPolicy:
class MockPolicy:
def __init__(self):
self.resolution_type = None
self.targets_for_ask = None
Expand Down Expand Up @@ -90,7 +90,7 @@ def policy():
Mock for FilePolicy object that will evaluate the requests.
"""

policy = TestPolicy()
policy = MockPolicy()
with mock.patch("qrexec.policy.parser.FilePolicy") as mock_policy:
mock_policy.return_value = policy
yield policy
Expand Down
4 changes: 2 additions & 2 deletions qrexec/tests/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
asyncio_fixture = pytest.fixture


class TestService(SocketService):
class MockService(SocketService):
async def handle_request(self, params, service, source_domain):
return json.dumps(
{
Expand All @@ -62,7 +62,7 @@ def temp_dir():
async def server(temp_dir):
socket_path = os.path.join(temp_dir, "Service")

service = TestService(socket_path)
service = MockService(socket_path)
server = await service.start()

try:
Expand Down

0 comments on commit 0f7bf45

Please sign in to comment.