Skip to content

Commit 3f3161e

Browse files
author
Dylan Huang
authored
Merge pull request #6 from eval-protocol/configure-stdout-for-python-debugging
configure stdout for pytest debugging
2 parents a7511ac + 9a71cf7 commit 3f3161e

File tree

3 files changed

+49
-8
lines changed

3 files changed

+49
-8
lines changed

.vscode/launch.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Python: Debug Tests",
6+
"type": "python",
7+
"request": "launch",
8+
"module": "pytest",
9+
"args": ["-s", "--tb=short", "${file}"],
10+
"console": "integratedTerminal",
11+
"justMyCode": false,
12+
"env": {
13+
"PYTHONPATH": "${workspaceFolder}"
14+
}
15+
},
16+
{
17+
"name": "Python: Debug Current File",
18+
"type": "python",
19+
"request": "launch",
20+
"program": "${file}",
21+
"console": "integratedTerminal",
22+
"justMyCode": false,
23+
"env": {
24+
"PYTHONPATH": "${workspaceFolder}"
25+
}
26+
},
27+
{
28+
"name": "Python: Debug Module",
29+
"type": "python",
30+
"request": "launch",
31+
"module": "eval_protocol",
32+
"console": "integratedTerminal",
33+
"justMyCode": false,
34+
"env": {
35+
"PYTHONPATH": "${workspaceFolder}"
36+
}
37+
}
38+
]
39+
}

.vscode/settings.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
2-
"python.testing.unittestEnabled": false,
3-
"python.testing.pytestEnabled": true,
4-
"python.testing.pytestArgs": [
5-
"tests",
6-
"examples"
7-
],
8-
"python.testing.autoTestDiscoverOnSaveEnabled": true,
9-
"python.defaultInterpreterPath": "./.venv/bin/python"
2+
"python.testing.unittestEnabled": false,
3+
"python.testing.pytestEnabled": true,
4+
"python.testing.pytestArgs": ["tests", "examples", "-s", "--tb=short"],
5+
"python.testing.autoTestDiscoverOnSaveEnabled": true,
6+
"python.defaultInterpreterPath": "./.venv/bin/python",
7+
"python.testing.cwd": "${workspaceFolder}"
108
}

pytest.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ testpaths = tests
77
python_files = test_*.py
88
python_classes = Test*
99
python_functions = test_*
10+
# Configure stdout/stderr capture for debugging
11+
addopts = -s --tb=short
12+
# Alternative: disable capture completely for debugging
13+
# addopts = -s --tb=short --capture=no
1014
filterwarnings =
1115
ignore::UserWarning:pydantic.*
1216
ignore::DeprecationWarning:pydantic.*

0 commit comments

Comments
 (0)