FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
vscode-python/python_files/testlauncher.py at main · Pythoneryeah/vscode-python · GitHub
Pythoneryeah
/
vscode-python
Public
forked from
microsoft/vscode-python
Notifications
You must be signed in to change notification settings
Fork
1
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
vscode-python
/
python_files
/
testlauncher.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (33 loc) · 974 Bytes
Breadcrumbs
vscode-python
/
python_files
/
testlauncher.py
Copy path
File metadata and controls
45 lines (33 loc) · 974 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import
os
import
sys
def
parse_argv
():
"""Parses arguments for use with the test launcher.
Arguments are:
1. Working directory.
2. Test runner `pytest`
3. Rest of the arguments are passed into the test runner.
"""
cwd
=
sys
.
argv
[
1
]
test_runner
=
sys
.
argv
[
2
]
args
=
sys
.
argv
[
3
:]
return
(
cwd
,
test_runner
,
args
)
def
run
(
cwd
,
test_runner
,
args
):
"""Runs the test.
cwd -- the current directory to be set
testRunner -- test runner to be used `pytest`
args -- arguments passed into the test runner
"""
sys
.
path
[
0
]
=
os
.
getcwd
()
# noqa: PTH109
os
.
chdir
(
cwd
)
try
:
if
test_runner
==
"pytest"
:
import
pytest
pytest
.
main
(
args
)
sys
.
exit
(
0
)
finally
:
pass
if
__name__
==
"__main__"
:
cwd
,
test_runner
,
args
=
parse_argv
()
run
(
cwd
,
test_runner
,
args
)
Back
|
FazBrowse Home
|
New Git URL