Skip to content

Commit 378037b

Browse files
authored
Update debug settings for vscode (#507)
This enables F5 debugging and debugging from test explorer using VS Code and pytest.
1 parent 80c6df1 commit 378037b

File tree

5 files changed

+36
-20
lines changed

5 files changed

+36
-20
lines changed

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ MSSQL_CLI_DATABASE=
33
MSSQL_CLI_USER=
44
MSSQL_CLI_PASSWORD=
55
PYTHONIOENCODING=UTF-8
6-
PYTHONPATH=${workspaceRoot}

.vscode/launch.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,34 @@
55
"name": "Python: Launch mssql-cli (integrated)",
66
"type": "python",
77
"request": "launch",
8-
"program": "${workspaceRoot}/mssqlcli/main.py",
9-
"envFile": "${workspaceRoot}/.env",
8+
"cwd": "${workspaceFolder}",
9+
"program": "${workspaceFolder}/mssqlcli/main.py",
10+
"envFile": "${workspaceFolder}/.env",
1011
"console": "integratedTerminal",
1112
},
1213
{
1314
"name": "Python: Launch mssql-cli (external)",
1415
"type": "python",
1516
"request": "launch",
16-
"program": "${workspaceRoot}/mssqlcli/main.py",
17-
"envFile": "${workspaceRoot}/.env",
17+
"cwd": "${workspaceFolder}",
18+
"program": "${workspaceFolder}/mssqlcli/main.py",
19+
"envFile": "${workspaceFolder}/.env",
1820
"console": "externalTerminal",
1921
},
2022
{
2123
"name": "Python: Current File (external)",
2224
"type": "python",
2325
"request": "launch",
2426
"program": "${file}",
25-
"envFile": "${workspaceRoot}/.env",
27+
"envFile": "${workspaceFolder}/.env",
2628
"console": "externalTerminal",
2729
},
2830
{
2931
"name": "Test Query (external)",
3032
"type": "python",
3133
"request": "launch",
32-
"program": "${workspaceRoot}/mssqlcli/main.py",
33-
"envFile": "${workspaceRoot}/.env",
34+
"program": "${workspaceFolder}/mssqlcli/main.py",
35+
"envFile": "${workspaceFolder}/.env",
3436
"console": "externalTerminal",
3537
"args": [
3638
"--query", "select * from t0"

.vscode/settings.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
2-
"python.pythonPath": "${workspaceRoot}/env/Scripts/python.exe",
3-
"python.linting.pylintEnabled": true,
4-
"python.testing.nosetestsEnabled": true,
5-
"python.testing.nosetestArgs": [
6-
"tests",
7-
"mssqlcli/jsonrpc/tests",
8-
"mssqlcli/jsonrpc/contracts/tests"
9-
],
10-
"python.testing.pytestEnabled": false,
11-
"python.testing.unittestEnabled": false
2+
"python.testing.unittestEnabled": false,
3+
"python.testing.nosetestsEnabled": false,
4+
"python.testing.pytestEnabled": true,
5+
"python.pythonPath": "env/bin/python",
6+
"python.testing.cwd": "${workspaceDir}",
7+
"python.terminal.activateEnvironment": true,
128
}

pytest.ini

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[pytest]
2+
testpaths=
3+
tests/test_mssqlcliclient.py
4+
tests/test_completion_refresher.py
5+
tests/test_config.py
6+
tests/test_naive_completion.py
7+
tests/test_main.py
8+
tests/test_multiline.py
9+
tests/test_fuzzy_completion.py
10+
tests/test_rowlimit.py
11+
tests/test_sqlcompletion.py
12+
tests/test_prioritization.py
13+
tests/jsonrpc/test_jsonrpc.py
14+
tests/jsonrpc/test_json_rpc_contracts.py
15+
tests/jsonrpc/test_jsonrpcclient.py
16+
tests/test_telemetry.py
17+
tests/test_localization.py
18+
tests/test_globalization.py
19+
tests/test_interactive_mode.py
20+
tests/test_noninteractive_mode.py
21+
tests/test_special.py

tests/pytest.ini

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)