FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
vscode-python/pythonFiles/tests/__main__.py at master · rrmistry/vscode-python · GitHub
rrmistry
/
vscode-python
Public
forked from
microsoft/vscode-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
9
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
/
pythonFiles
/
tests
/
__main__.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (37 loc) · 1.33 KB
Breadcrumbs
vscode-python
/
pythonFiles
/
tests
/
__main__.py
Copy path
File metadata and controls
51 lines (37 loc) · 1.33 KB
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
46
47
48
49
50
51
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import
argparse
import
os
.
path
import
sys
import
pytest
TEST_ROOT
=
os
.
path
.
dirname
(
__file__
)
SRC_ROOT
=
os
.
path
.
dirname
(
TEST_ROOT
)
PROJECT_ROOT
=
os
.
path
.
dirname
(
SRC_ROOT
)
IPYTHON_ROOT
=
os
.
path
.
join
(
SRC_ROOT
,
'ipython'
)
TESTING_TOOLS_ROOT
=
os
.
path
.
join
(
SRC_ROOT
,
'testing_tools'
)
def
parse_args
():
parser
=
argparse
.
ArgumentParser
()
# To mark a test as functional: (decorator) @pytest.mark.functional
parser
.
add_argument
(
'--functional'
,
dest
=
'markers'
,
action
=
'append_const'
,
const
=
'functional'
)
parser
.
add_argument
(
'--no-functional'
,
dest
=
'markers'
,
action
=
'append_const'
,
const
=
'not functional'
)
args
,
remainder
=
parser
.
parse_known_args
()
ns
=
vars
(
args
)
return
ns
,
remainder
def
main
(
pytestargs
,
markers
=
None
):
sys
.
path
.
insert
(
1
,
IPYTHON_ROOT
)
sys
.
path
.
insert
(
1
,
TESTING_TOOLS_ROOT
)
pytestargs
=
[
'--rootdir'
,
SRC_ROOT
,
TEST_ROOT
,
]
+
pytestargs
for
marker
in
reversed
(
markers
or
()):
pytestargs
.
insert
(
0
,
marker
)
pytestargs
.
insert
(
0
,
'-m'
)
ec
=
pytest
.
main
(
pytestargs
)
return
ec
if
__name__
==
'__main__'
:
mainkwargs
,
pytestargs
=
parse_args
()
ec
=
main
(
pytestargs
,
**
mainkwargs
)
sys
.
exit
(
ec
)
Back
|
FazBrowse Home
|
New Git URL