Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Updated pytest-timeout changes internal functions

Open
#1,620 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
testing-qa

Research direction

Start with tests/logs.py and tests/pytest_hooks.py, then compare their pytest-timeout usage with the 2.3.0 API changes described in the issue. Run the relevant debugpy tests; done means both affected test integrations work with pytest-timeout 2.3.0 without relying on the removed function or omitting the new argument.

Written by the indexing model from the issue text.

Description

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())    
Dominant language
Python
Stars
2.5k
Forks
202
Avg merge
5d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

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 microsoft/debugpy

All issues in microsoft/debugpy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.