Updated pytest-timeout changes internal functions
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
pytest-timeout version 2.3.0 has changed two internal functions that debugpy uses in its tests:
write_title()has been removed (used intests/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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/debugpy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in microsoft/debugpy
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
huggingface/Repo2RLEnv#163 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NousResearch/hermes-agent#121143 ·