fix: add missing closes to tests (#49)
This commit is contained in:
parent
2d9ed9748b
commit
d2ce4a1846
@ -182,3 +182,5 @@ async def test_methods(interface_class):
|
|||||||
|
|
||||||
bus1.disconnect()
|
bus1.disconnect()
|
||||||
bus2.disconnect()
|
bus2.disconnect()
|
||||||
|
bus1._sock.close()
|
||||||
|
bus2._sock.close()
|
||||||
|
|||||||
@ -245,6 +245,8 @@ async def test_property_methods(interface_class):
|
|||||||
|
|
||||||
bus1.disconnect()
|
bus1.disconnect()
|
||||||
bus2.disconnect()
|
bus2.disconnect()
|
||||||
|
bus1._sock.close()
|
||||||
|
bus2._sock.close()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("interface_class", [ExampleInterface, AsyncInterface])
|
@pytest.mark.parametrize("interface_class", [ExampleInterface, AsyncInterface])
|
||||||
@ -301,3 +303,5 @@ async def test_property_changed_signal(interface_class):
|
|||||||
|
|
||||||
bus1.disconnect()
|
bus1.disconnect()
|
||||||
bus2.disconnect()
|
bus2.disconnect()
|
||||||
|
bus1._sock.close()
|
||||||
|
bus2._sock.close()
|
||||||
|
|||||||
@ -161,6 +161,8 @@ async def test_signals():
|
|||||||
|
|
||||||
bus1.disconnect()
|
bus1.disconnect()
|
||||||
bus2.disconnect()
|
bus2.disconnect()
|
||||||
|
bus1._sock.close()
|
||||||
|
bus2._sock.close()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
@ -255,3 +257,5 @@ async def test_interface_add_remove_signal():
|
|||||||
|
|
||||||
bus1.disconnect()
|
bus1.disconnect()
|
||||||
bus2.disconnect()
|
bus2.disconnect()
|
||||||
|
bus1._sock.close()
|
||||||
|
bus2._sock.close()
|
||||||
|
|||||||
@ -113,6 +113,8 @@ def test_sending_messages_between_buses():
|
|||||||
|
|
||||||
bus1.disconnect()
|
bus1.disconnect()
|
||||||
bus2.disconnect()
|
bus2.disconnect()
|
||||||
|
bus1._sock.close()
|
||||||
|
bus2._sock.close()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
||||||
@ -164,3 +166,5 @@ def test_sending_signals_between_buses():
|
|||||||
|
|
||||||
bus1.disconnect()
|
bus1.disconnect()
|
||||||
bus2.disconnect()
|
bus2.disconnect()
|
||||||
|
bus1._sock.close()
|
||||||
|
bus2._sock.close()
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import os
|
|||||||
from dbus_fast import ArgDirection, PropertyAccess, SignatureType
|
from dbus_fast import ArgDirection, PropertyAccess, SignatureType
|
||||||
from dbus_fast import introspection as intr
|
from dbus_fast import introspection as intr
|
||||||
|
|
||||||
example_data = open(f"{os.path.dirname(__file__)}/data/introspection.xml").read()
|
with open(f"{os.path.dirname(__file__)}/data/introspection.xml") as f:
|
||||||
|
example_data = f.read()
|
||||||
|
|
||||||
|
|
||||||
def test_example_introspection_from_xml():
|
def test_example_introspection_from_xml():
|
||||||
|
|||||||
@ -21,7 +21,8 @@ def print_buf(buf):
|
|||||||
|
|
||||||
|
|
||||||
# these messages have been verified with another library
|
# these messages have been verified with another library
|
||||||
table = json.load(open(os.path.dirname(__file__) + "/data/messages.json"))
|
with open(os.path.dirname(__file__) + "/data/messages.json") as f:
|
||||||
|
table = json.load(f)
|
||||||
|
|
||||||
|
|
||||||
def json_to_message(message: Dict[str, Any]) -> Message:
|
def json_to_message(message: Dict[str, Any]) -> Message:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user