[launch_pytest]: Output buffered in fixture.

未关闭
#683 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
testing

调研方向

首先,使用 pytest -s 和提供的 FastapiClient 示例复现 launch_pytest fixture 的行为。跟踪 fixture 设置期间如何处理 launch 输出,并在 fixture 等待时能够看到 process 和 launch 日志,而不是只有在 test_fastapi_client 启动后才看到时,将该 issue 视为完成。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
156
派生
200
平均合并
2 天 11 小时
30 天内合并 PR
11

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ros2/launch 的其他 Issue

查看 ros2/launch 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。