Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7351f9e5
Commit
7351f9e5
authored
7 years ago
by
Serhiy Storchaka
Committed by
GitHub
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-31174: Improve the code of test_tools.test_unparse. (#4146)
parent
03eb11f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Lib/test/test_tools/test_unparse.py
Lib/test/test_tools/test_unparse.py
+8
-8
No files found.
Lib/test/test_tools/test_unparse.py
View file @
7351f9e5
...
...
@@ -268,12 +268,13 @@ class DirectoryTestCase(ASTTestCase):
# test directories, relative to the root of the distribution
test_directories
=
'Lib'
,
os
.
path
.
join
(
'Lib'
,
'test'
)
def
get_names
(
self
):
if
DirectoryTestCase
.
NAMES
is
not
None
:
return
DirectoryTestCase
.
NAMES
@
classmethod
def
get_names
(
cls
):
if
cls
.
NAMES
is
not
None
:
return
cls
.
NAMES
names
=
[]
for
d
in
self
.
test_directories
:
for
d
in
cls
.
test_directories
:
test_dir
=
os
.
path
.
join
(
basepath
,
d
)
for
n
in
os
.
listdir
(
test_dir
):
if
n
.
endswith
(
'.py'
)
and
not
n
.
startswith
(
'bad'
):
...
...
@@ -284,8 +285,7 @@ class DirectoryTestCase(ASTTestCase):
names
=
random
.
sample
(
names
,
10
)
# bpo-31174: Store the names sample to always test the same files.
# It prevents false alarms when hunting reference leaks.
DirectoryTestCase
.
NAMES
=
names
cls
.
NAMES
=
names
return
names
def
test_files
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment