Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Updated pytest-timeout changes internal functions

オープン
#1,620 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
testing-qa

調査の方向性

tests/logs.py と tests/pytest_hooks.py から始め、次に、それらでの pytest-timeout の使用方法を、issue に記載された 2.3.0 の API 変更と比較します。関連する debugpy テストを実行します。両方の影響を受けるテスト統合が、削除された関数に依存したり新しい引数を省略したりせずに pytest-timeout 2.3.0 で動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

pytest-timeout version 2.3.0 has changed two internal functions that debugpy uses in its tests:

  • write_title() has been removed (used in tests/logs.py)
  • dump_stacks() now takes an argument (terminal)

I have addressed the first one in Debian in a hackish way:

--- a/tests/logs.py                                                             
+++ b/tests/logs.py                                                             
@@ -4,7 +4,7 @@                                                                 
                                                                                
 import io                                                                      
 import os                                                                      
-import pytest_timeout                                                          
+from _pytest._io import TerminalWriter                                         
 import sys                                                                     
                                                                                
 from debugpy.common import json, log                                           
@@ -27,5 +27,6 @@                                                               
                 pass                                                           
             else:                                                              
                 path = os.path.relpath(path, log.log_dir)                      
-                pytest_timeout.write_title(path)                               
+                out = TerminalWriter()                                         
+                out.sep("+", title=path)                                       
                 print(s, file=sys.stderr)                                      

but see https://github.com/pytest-dev/pytest/issues/10436 for a warning about this approach. For the second, I've done this:

--- a/tests/pytest_hooks.py                                                     
+++ b/tests/pytest_hooks.py                                                     
@@ -61,4 +61,4 @@                                                               
 # we want to print the pydevd log as well. This is not a normal pytest hook - \
we                                                                              
 # just detour pytest_timeout.dump_stacks directly.                             
 _dump_stacks = pytest_timeout.dump_stacks                                      
-pytest_timeout.dump_stacks = lambda: (_dump_stacks(), logs.dump())             
+pytest_timeout.dump_stacks = lambda term: (_dump_stacks(term), logs.dump())    
主要言語
Python
スター
2.5k
フォーク
202
平均マージ
5日 1時間
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/debugpy のほかの issue

microsoft/debugpy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。