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

Bad and misleading test

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

@hfycium đang làm issue này rồi.

Từ ngày 5/10/2026.

  • #208 của @hfycium — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
testing-qa

Hướng nghiên cứu

Bắt đầu với test_not_main_thread.py và xem xét pull request cùng commit đã đưa nó vào. Chạy test để xác nhận liệu quá trình collection có thất bại trước bất kỳ assertion nào hay không, sau đó xác định hành vi timeout dự kiến và làm cho test thực thi hành vi đó. Hoàn tất khi test không còn pass hoặc fail chỉ vì thiếu pytest_timeout.timeout_setup.

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

Mô tả

I believe there's a test that is not testing anything anymore.
The test was introduced in https://github.com/pytest-dev/pytest-timeout/pull/88, https://github.com/pytest-dev/pytest-timeout/commit/1a35f94298c1260500907bd674b75cf59df0c949

================================================================================================ test session starts ================================================================================================
platform linux -- Python 3.10.2, pytest-7.4.3, pluggy-1.3.0
rootdir: /tmp/pytest-of-vampas/pytest-4/test_not_main_thread0
plugins: github-actions-annotate-failures-0.2.0, timeout-2.2.0, cov-4.1.0
timeout: 1.0s
timeout method: signal
timeout func_only: False
collected 0 items / 1 error
====================================================================================================== ERRORS =======================================================================================================
_____________________________________________________________________________________ ERROR collecting test_not_main_thread.py ______________________________________________________________________________________
/home/vampas/projects/SaltStack/pytest/timeout/hotfix/settings-hook/.tox/py310/lib/python3.10/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
/home/vampas/projects/SaltStack/pytest/timeout/hotfix/settings-hook/.tox/py310/lib/python3.10/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/home/vampas/projects/SaltStack/pytest/timeout/hotfix/settings-hook/.tox/py310/lib/python3.10/site-packages/_pytest/python.py:531: in collect
    self._inject_setup_module_fixture()
/home/vampas/projects/SaltStack/pytest/timeout/hotfix/settings-hook/.tox/py310/lib/python3.10/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
/home/vampas/projects/SaltStack/pytest/timeout/hotfix/settings-hook/.tox/py310/lib/python3.10/site-packages/_pytest/python.py:310: in obj
    self._obj = obj = self._getobj()
/home/vampas/projects/SaltStack/pytest/timeout/hotfix/settings-hook/.tox/py310/lib/python3.10/site-packages/_pytest/python.py:528: in _getobj
    return self._importtestmodule()
/home/vampas/projects/SaltStack/pytest/timeout/hotfix/settings-hook/.tox/py310/lib/python3.10/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/home/vampas/projects/SaltStack/pytest/timeout/hotfix/settings-hook/.tox/py310/lib/python3.10/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/home/vampas/.pyenv/versions/3.10.2/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/home/vampas/projects/SaltStack/pytest/timeout/hotfix/settings-hook/.tox/py310/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
test_not_main_thread.py:4: in <module>
    current_timeout_setup = pytest_timeout.timeout_setup
E   AttributeError: module 'pytest_timeout' has no attribute 'timeout_setup'
============================================================================================== short test summary info ==============================================================================================
ERROR test_not_main_thread.py - AttributeError: module 'pytest_timeout' has no attribute 'timeout_setup'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================================= 1 error in 0.20s ==================================================================================================

Is this really what is getting tested? The error?

Ngôn ngữ chính
Python
Star
260
Fork
70
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-timeout

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

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.