Skip to content

Commit

Permalink
tests: Do not use Parenthesized context managers
Browse files Browse the repository at this point in the history
It was added in Python 3.10 so trying to run the tests on earlier
version raises SynxtaxError.
  • Loading branch information
igo95862 committed Feb 4, 2024
1 parent 6010f26 commit 60bd82c
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions test/test_sdbus_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,24 +431,18 @@ async def test_signal(self) -> None:

test_tuple = ('sgfsretg', 'asd')

async with (
self.assertDbusSignalEmits(
async with self.assertDbusSignalEmits(
test_object.test_signal
) as local_signals_record,
self.assertDbusSignalEmits(
) as local_signals_record, self.assertDbusSignalEmits(
test_object_connection.test_signal
) as remote_signals_record
):
) as remote_signals_record:
test_object.test_signal.emit(test_tuple)

async with (
self.assertDbusSignalEmits(
async with self.assertDbusSignalEmits(
test_object.test_signal
) as local_signals_record,
self.assertDbusSignalEmits(
) as local_signals_record, self.assertDbusSignalEmits(
test_object_connection.test_signal
) as remote_signals_record
):
) as remote_signals_record:
test_object.test_signal.emit(test_tuple)

local_signals_record.assert_emitted_once_with(test_tuple)
Expand Down Expand Up @@ -739,14 +733,11 @@ async def test_properties_get_all_dict(self) -> None:
async def test_empty_signal(self) -> None:
test_object, test_object_connection = initialize_object()

async with (
self.assertDbusSignalEmits(
async with self.assertDbusSignalEmits(
test_object.empty_signal
) as local_signals_record,
self.assertDbusSignalEmits(
) as local_signals_record, self.assertDbusSignalEmits(
test_object_connection.empty_signal
) as remote_signals_record
):
) as remote_signals_record:
test_object.empty_signal.emit(None)

local_signals_record.assert_emitted_once_with(None)
Expand Down

0 comments on commit 60bd82c

Please sign in to comment.