Skip to content

Commit c70d29a

Browse files
committed
removed event loop fixture
1 parent 35e2387 commit c70d29a

7 files changed

Lines changed: 14 additions & 13 deletions

File tree

tests/e2e/iothub_e2e/aio/test_c2d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
class TestReceiveC2d(object):
2020
@pytest.mark.it("Can receive C2D")
2121
@pytest.mark.quicktest_suite
22-
async def test_receive_c2d(self, client, service_helper, event_loop, leak_tracker):
22+
async def test_receive_c2d(self, client, service_helper, leak_tracker):
2323
leak_tracker.set_initial_object_list()
24+
event_loop = asyncio.get_running_loop()
2425

2526
message = json.dumps(get_random_dict())
2627

tests/e2e/iothub_e2e/aio/test_connect_disconnect.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def test_connect_disconnect(self, brand_new_client, leak_tracker):
4242
# see "This assert fails because of initial and secondary disconnects" below
4343
@pytest.mark.skip(reason="two stage disconnect causes assertion in test code")
4444
async def test_connect_in_the_middle_of_disconnect(
45-
self, brand_new_client, event_loop, service_helper, random_message, leak_tracker
45+
self, brand_new_client, service_helper, random_message, leak_tracker
4646
):
4747
"""
4848
Explanation: People will call `connect` inside `on_connection_state_change` handlers.
@@ -52,6 +52,7 @@ async def test_connect_in_the_middle_of_disconnect(
5252
assert client
5353

5454
leak_tracker.set_initial_object_list()
55+
event_loop = asyncio.get_running_loop()
5556

5657
reconnected_event = asyncio.Event()
5758

@@ -110,7 +111,6 @@ async def handle_on_connection_state_change():
110111
async def test_disconnect_in_the_middle_of_connect(
111112
self,
112113
brand_new_client,
113-
event_loop,
114114
service_helper,
115115
random_message,
116116
first_connect,
@@ -126,6 +126,7 @@ async def test_disconnect_in_the_middle_of_connect(
126126
disconnect_on_next_connect_event = False
127127

128128
leak_tracker.set_initial_object_list()
129+
event_loop = asyncio.get_running_loop()
129130

130131
disconnected_event = asyncio.Event()
131132

tests/e2e/iothub_e2e/aio/test_sas_renewal.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ class TestSasRenewal(object):
2222
@pytest.mark.it("Renews and reconnects before expiry")
2323
@pytest.mark.parametrize(*parametrize.connection_retry_disabled_and_enabled)
2424
@pytest.mark.parametrize(*parametrize.auto_connect_disabled_and_enabled)
25-
async def test_sas_renews(
26-
self, client, event_loop, service_helper, random_message, leak_tracker
27-
):
25+
async def test_sas_renews(self, client, service_helper, random_message, leak_tracker):
2826
leak_tracker.set_initial_object_list()
27+
event_loop = asyncio.get_running_loop()
2928

3029
connected_event = asyncio.Event()
3130
disconnected_event = asyncio.Event()

tests/e2e/iothub_e2e/aio/test_twin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,9 @@ async def test_updates_reported_if_reject_before_sending(
190190
class TestDesiredProperties(object):
191191
@pytest.mark.it("Receives a patch for a simple desired property")
192192
@pytest.mark.quicktest_suite
193-
async def test_receives_simple_desired_patch(
194-
self, client, event_loop, service_helper, leak_tracker
195-
):
193+
async def test_receives_simple_desired_patch(self, client, service_helper, leak_tracker):
196194
leak_tracker.set_initial_object_list()
195+
event_loop = asyncio.get_running_loop()
197196

198197
received_patch = None
199198
received = asyncio.Event()

tests/e2e/iothub_e2e/aio/test_twin_stress.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,14 @@ async def test_stress_parallel_reported_property_updates(
157157
)
158158
@pytest.mark.it("Can receive continuous desired property updates that were sent one-at-a-time")
159159
async def test_stress_serial_desired_property_updates(
160-
self, client, service_helper, toxic, iteration_count, event_loop, leak_tracker
160+
self, client, service_helper, toxic, iteration_count, leak_tracker
161161
):
162162
"""
163163
Update desired properties, one at a time, and verify that the desired property arrives
164164
at the client before the next update.
165165
"""
166166
leak_tracker.set_initial_object_list()
167+
event_loop = asyncio.get_running_loop()
167168

168169
patches = asyncio.Queue()
169170

@@ -200,13 +201,14 @@ async def handle_on_patch_received(patch):
200201
"Can receive continuous desired property updates that may have been sent in parallel"
201202
)
202203
async def test_stress_parallel_desired_property_updates(
203-
self, client, service_helper, toxic, iteration_count, batch_size, event_loop, leak_tracker
204+
self, client, service_helper, toxic, iteration_count, batch_size, leak_tracker
204205
):
205206
"""
206207
Update desired properties in batches. Each batch updates `batch_size` properties,
207208
with each property being updated in it's own `PATCH`.
208209
"""
209210
leak_tracker.set_initial_object_list()
211+
event_loop = asyncio.get_running_loop()
210212

211213
patches = asyncio.Queue()
212214

tests/e2e/iothub_e2e/pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ junit_family=xunit2
66
junit_log_passing_tests=True
77
asyncio_mode=auto
88
asyncio_legacy_mode=true
9-
asyncio_default_fixture_loop_scope = function
9+
; asyncio_default_fixture_loop_scope = function
1010
addopts=
1111
--testdox
1212
--force-testdox

tests/e2e/provisioning_e2e/pytest.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ timeout=30
33
testdox_format=plaintext
44
asyncio_mode=auto
55
asyncio_legacy_mode=true
6-
asyncio_default_fixture_loop_scope = function
76
addopts=
87
--testdox
98
--force-testdox

0 commit comments

Comments
 (0)