launch icon indicating copy to clipboard operation
launch copied to clipboard

[launch_pytest]: Output buffered in fixture.

Open rshanor opened this issue 3 years ago • 0 comments

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04
  • Installation type:
    • Docker
  • Version or commit hash:
    • ros:rolling-ros-core-jammy
  • Client library (if applicable):
    • launch_pytest

Steps to reproduce issue

I run pytest with the -s flag, but output is buffered until the test actually starts to execute.

@pytest.fixture(scope="function")
def client():
    _client = FastapiClient()
    _client.assert_wait_for_services(timeout_sec=120)
    return _client

@pytest.mark.launch(fixture=generate_test_description)
def test_fastapi_client(client):
    assert True

Expected behavior

I expect launch log output to print to screen while my all my processes launch.

Actual behavior

Nothing prints in the terminal until test_fastapi_client actually started. This could be 120 seconds given the _client.assert_wait_for_services line. I simplified this example but its not as easy to move construction into my actual test.

Happy to help contribute if someone with more experience can point me in the right direction.

rshanor avatar Dec 05 '22 19:12 rshanor