Skip to content

Commit

Permalink
Inherit from DBusTestCase directly in DNS provider test
Browse files Browse the repository at this point in the history
This allows the DBus mock server to be properly torn down once the
tests are done running. DBusTestCase inherits from unittest.TestCase,
so it remains functionally identical.
  • Loading branch information
knuxify authored and cschramm committed May 14, 2024
1 parent 732b388 commit 83685e9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/main/test_dns_server_provider.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from ipaddress import IPv4Address
from typing import Callable
from unittest import TestCase
from unittest.mock import patch, Mock

from dbusmock import DBusTestCase
Expand All @@ -18,10 +17,10 @@
Gio.DBusConnectionFlags.MESSAGE_BUS_CONNECTION | Gio.DBusConnectionFlags.AUTHENTICATION_CLIENT,
)
)
class TestDNSServerProvider(TestCase):
class TestDNSServerProvider(DBusTestCase):
@classmethod
def setUpClass(cls) -> None:
DBusTestCase.start_system_bus()
cls.start_system_bus()

def test_resolver(self):
with open("/tmp/resolv.conf", "w") as f:
Expand Down

0 comments on commit 83685e9

Please sign in to comment.