FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/Lib/test/regrtest.py at main · python/cpython · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python
/
cpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
35.3k
Star
75k
Code
Issues
5k+
Pull requests
2.6k
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
Lib
/
test
/
regrtest.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
47 lines (34 loc) · 1.27 KB
Breadcrumbs
cpython
/
Lib
/
test
/
regrtest.py
Copy path
File metadata and controls
executable file
·
47 lines (34 loc) · 1.27 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
#! /usr/bin/env python3
"""
Script to run Python regression tests.
Run this script with -h or --help for documentation.
"""
import
os
import
sys
from
test
.
libregrtest
.
main
import
main
# Alias for backward compatibility (just in case)
main_in_temp_cwd
=
main
def
_main
():
global
__file__
# Remove regrtest.py's own directory from the module search path. Despite
# the elimination of implicit relative imports, this is still needed to
# ensure that submodules of the test package do not inappropriately appear
# as top-level modules even when people (or buildbots!) invoke regrtest.py
# directly instead of using the -m switch
mydir
=
os
.
path
.
abspath
(
os
.
path
.
normpath
(
os
.
path
.
dirname
(
sys
.
argv
[
0
])))
i
=
len
(
sys
.
path
)
-
1
while
i
>=
0
:
if
os
.
path
.
abspath
(
os
.
path
.
normpath
(
sys
.
path
[
i
]))
==
mydir
:
del
sys
.
path
[
i
]
else
:
i
-=
1
# findtestdir() gets the dirname out of __file__, so we have to make it
# absolute before changing the working directory.
# For example __file__ may be relative when running trace or profile.
# See issue #9323.
__file__
=
os
.
path
.
abspath
(
__file__
)
# sanity check
assert
__file__
==
os
.
path
.
abspath
(
sys
.
argv
[
0
])
main
()
if
__name__
==
'__main__'
:
_main
()
Back
|
FazBrowse Home
|
New Git URL