Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Integration with pytest-timeout plugin

Đang mở
#21 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
testing

Hướng nghiên cứu

Bắt đầu bằng cách lần theo pytest_forked/init.py, đặc biệt là pytest_runtest_protocol và forked_run_report, qua py/_process/forkedfunc.py và đường dẫn timeout trong pytest_timeout.py. Xác định xem traceback của test được bao bọc có thể được giữ lại hay không, đồng thời xem xét phần việc cần thực hiện để timeout báo cáo thông tin hữu ích từ test được bao bọc thay vì chỉ các frame của pytest-forked.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi, when trying to add pytest-timeout to troubleshoot a hanging test, I get the following output:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/_pytest/main.py", line 203, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/opt/conda/lib/python3.6/site-packages/_pytest/main.py", line 243, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/opt/conda/lib/python3.6/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/opt/conda/lib/python3.6/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/opt/conda/lib/python3.6/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/opt/conda/lib/python3.6/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/opt/conda/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/opt/conda/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/opt/conda/lib/python3.6/site-packages/_pytest/main.py", line 264, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "/opt/conda/lib/python3.6/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/opt/conda/lib/python3.6/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/opt/conda/lib/python3.6/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/opt/conda/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/opt/conda/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/opt/conda/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/opt/conda/lib/python3.6/site-packages/pytest_forked/__init__.py", line 35, in pytest_runtest_protocol
    reports = forked_run_report(item)
  File "/opt/conda/lib/python3.6/site-packages/pytest_forked/__init__.py", line 56, in forked_run_report
    result = ff.waitfinish()
  File "/opt/conda/lib/python3.6/site-packages/py/_process/forkedfunc.py", line 82, in waitfinish
    pid, systemstatus = waiter(self.pid, 0)
  File "/opt/conda/lib/python3.6/site-packages/pytest_timeout.py", line 140, in handler
    timeout_sigalrm(item, params.timeout)
  File "/opt/conda/lib/python3.6/site-packages/pytest_timeout.py", line 313, in timeout_sigalrm
    pytest.fail('Timeout >%ss' % timeout)
  File "/opt/conda/lib/python3.6/site-packages/_pytest/outcomes.py", line 113, in fail
    raise Failed(msg=msg, pytrace=pytrace)
Failed: Timeout >120.0s

Seems that the traceback includes only pytest-forked information.
Do you know if it's at all possible to get some traceback info from the wrapped test?
Thanks.

Ngôn ngữ chính
Python
Star
84
Fork
30
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pytest-dev/pytest-forked

Tất cả issue của pytest-dev/pytest-forked

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.