Skip to content

Commit 74bbec3

Browse files
committed
logs to debug on windows without a VM
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
1 parent 7a2dde8 commit 74bbec3

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

launch_pytest/launch_pytest/fixture.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,26 @@ def get_event_loop_fixture(*, scope='function', overridable=True):
7272
@pytest.fixture(scope=scope)
7373
def event_loop():
7474
"""Create an event loop instance for each test case."""
75+
import sys
76+
import traceback
7577
loop = asyncio.get_event_loop_policy().new_event_loop()
7678
policy = asyncio.get_event_loop_policy()
7779
try:
7880
old_loop = policy.get_event_loop()
7981
if old_loop is not loop:
8082
old_loop.close()
83+
print('bye event loop 2', file=sys.stderr)
84+
traceback.print_stack()
8185
except RuntimeError:
8286
# Swallow this, since it's probably bad event loop hygiene.
8387
pass
8488
policy.set_event_loop(loop)
89+
print('new event loop', file=sys.stderr)
8590
yield loop
8691
loop.close()
8792
asyncio.set_event_loop_policy(None)
93+
print('bye event loop 1', file=sys.stderr)
94+
traceback.print_stack()
8895
if overridable:
8996
event_loop._launch_pytest_overridable_fixture = True
9097
event_loop._launch_pytest_fixture_scope = scope

launch_pytest/test/launch_pytest/tools/test_process.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
time.sleep(5)
2828
"""
2929

30+
import sys
3031

3132
@pytest.fixture
3233
def dut():
@@ -39,13 +40,15 @@ def dut():
3940

4041
@launch_pytest.fixture
4142
def launch_description(dut):
43+
print('new launch description', file=sys.stderr)
4244
return launch.LaunchDescription([
4345
dut,
4446
])
4547

4648

4749
@pytest.mark.launch(fixture=launch_description)
4850
async def test_async_process_tools(dut, launch_context):
51+
print('test async', file=sys.stderr)
4952
await tools.wait_for_start(launch_context, dut, timeout=10)
5053
def check_output(output): assert output == 'hello\n'
5154
await tools.wait_for_output(
@@ -59,6 +62,7 @@ def check_stderr(err): assert err == 'world\n'
5962

6063
@pytest.mark.launch(fixture=launch_description)
6164
def test_sync_process_tools(dut, launch_context):
65+
print('test sync', file=sys.stderr)
6266
tools.wait_for_start_sync(launch_context, dut, timeout=10)
6367
def check_output(output): assert output == 'hello\n'
6468
tools.wait_for_output_sync(

0 commit comments

Comments
 (0)