[launch_pytest]: Output buffered in fixture.

Open
#683 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
testing

Research direction

Start by reproducing the launch_pytest fixture behavior with pytest -s and the provided FastapiClient example. Trace how launch output is handled during fixture setup, and consider the issue done when process and launch logs appear while the fixture is waiting rather than only after test_fastapi_client starts.

Written by the indexing model from the issue text.

Description

backlog

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.

Dominant language
Python
Stars
156
Forks
200
Avg merge
2d 11h
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ros2/launch

All issues in ros2/launch

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.