Skip to content

Commit 37d7b48

Browse files
committed
finally block
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent 583d4d1 commit 37d7b48

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/e2e/test_concurrent_telemetry.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ def telemetry_setup_teardown(self):
3636
TelemetryClientFactory._executor = None
3737
TelemetryClientFactory._initialized = False
3838

39-
yield # This is where the test runs
40-
41-
# --- TEARDOWN ---
42-
if TelemetryClientFactory._executor:
43-
TelemetryClientFactory._executor.shutdown(wait=True)
44-
TelemetryClientFactory._executor = None
45-
TelemetryClientFactory._initialized = False
39+
try:
40+
yield # This is where the test runs
41+
finally:
42+
# --- TEARDOWN ---
43+
if TelemetryClientFactory._executor:
44+
TelemetryClientFactory._executor.shutdown(wait=True)
45+
TelemetryClientFactory._executor = None
46+
TelemetryClientFactory._initialized = False
4647

4748
def test_concurrent_queries_sends_telemetry(self):
4849
"""

0 commit comments

Comments
 (0)