Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
ac33bd7d
Kaydet (Commit)
ac33bd7d
authored
Kas 11, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #23839: Various caches now are cleared before running every test file.
üst
a33deb2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
24 deletions
+94
-24
regrtest.py
Lib/test/regrtest.py
+92
-24
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/regrtest.py
Dosyayı görüntüle @
ac33bd7d
...
@@ -931,6 +931,7 @@ def runtest_inner(test, verbose, quiet, huntrleaks=False, pgo=False):
...
@@ -931,6 +931,7 @@ def runtest_inner(test, verbose, quiet, huntrleaks=False, pgo=False):
else
:
else
:
# Always import it from the test package
# Always import it from the test package
abstest
=
'test.'
+
test
abstest
=
'test.'
+
test
clear_caches
()
with
saved_test_environment
(
test
,
verbose
,
quiet
,
pgo
)
as
environment
:
with
saved_test_environment
(
test
,
verbose
,
quiet
,
pgo
)
as
environment
:
start_time
=
time
.
time
()
start_time
=
time
.
time
()
the_package
=
__import__
(
abstest
,
globals
(),
locals
(),
[])
the_package
=
__import__
(
abstest
,
globals
(),
locals
(),
[])
...
@@ -1096,16 +1097,6 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
...
@@ -1096,16 +1097,6 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
def
dash_R_cleanup
(
fs
,
ps
,
pic
,
zdc
,
abcs
):
def
dash_R_cleanup
(
fs
,
ps
,
pic
,
zdc
,
abcs
):
import
gc
,
copy_reg
import
gc
,
copy_reg
import
_strptime
,
linecache
dircache
=
test_support
.
import_module
(
'dircache'
,
deprecated
=
True
)
import
urlparse
,
urllib
,
urllib2
,
mimetypes
,
doctest
import
struct
,
filecmp
from
distutils.dir_util
import
_path_created
# Clear the warnings registry, so they can be displayed again
for
mod
in
sys
.
modules
.
values
():
if
hasattr
(
mod
,
'__warningregistry__'
):
del
mod
.
__warningregistry__
# Restore some original values.
# Restore some original values.
warnings
.
filters
[:]
=
fs
warnings
.
filters
[:]
=
fs
...
@@ -1130,23 +1121,100 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
...
@@ -1130,23 +1121,100 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
abc
.
_abc_cache
.
clear
()
abc
.
_abc_cache
.
clear
()
abc
.
_abc_negative_cache
.
clear
()
abc
.
_abc_negative_cache
.
clear
()
clear_caches
()
def
clear_caches
():
import
gc
# Clear the warnings registry, so they can be displayed again
for
mod
in
sys
.
modules
.
values
():
if
hasattr
(
mod
,
'__warningregistry__'
):
del
mod
.
__warningregistry__
# Clear assorted module caches.
# Clear assorted module caches.
_path_created
.
clear
()
# Don't worry about resetting the cache if the module is not loaded
try
:
distutils_dir_util
=
sys
.
modules
[
'distutils.dir_util'
]
except
KeyError
:
pass
else
:
distutils_dir_util
.
_path_created
.
clear
()
re
.
purge
()
re
.
purge
()
_strptime
.
_regex_cache
.
clear
()
urlparse
.
clear_cache
()
urllib
.
urlcleanup
()
urllib2
.
install_opener
(
None
)
dircache
.
reset
()
linecache
.
clearcache
()
mimetypes
.
_default_mime_types
()
filecmp
.
_cache
.
clear
()
struct
.
_clearcache
()
doctest
.
master
=
None
try
:
try
:
import
ctypes
_strptime
=
sys
.
modules
[
'_strptime'
]
except
ImportError
:
except
KeyError
:
# Don't worry about resetting the cache if ctypes is not supported
pass
else
:
_strptime
.
_regex_cache
.
clear
()
try
:
urlparse
=
sys
.
modules
[
'urlparse'
]
except
KeyError
:
pass
else
:
urlparse
.
clear_cache
()
try
:
urllib
=
sys
.
modules
[
'urllib'
]
except
KeyError
:
pass
else
:
urllib
.
urlcleanup
()
try
:
urllib2
=
sys
.
modules
[
'urllib2'
]
except
KeyError
:
pass
else
:
urllib2
.
install_opener
(
None
)
try
:
dircache
=
sys
.
modules
[
'dircache'
]
except
KeyError
:
pass
else
:
dircache
.
reset
()
try
:
linecache
=
sys
.
modules
[
'linecache'
]
except
KeyError
:
pass
else
:
linecache
.
clearcache
()
try
:
mimetypes
=
sys
.
modules
[
'mimetypes'
]
except
KeyError
:
pass
else
:
mimetypes
.
_default_mime_types
()
try
:
filecmp
=
sys
.
modules
[
'filecmp'
]
except
KeyError
:
pass
else
:
filecmp
.
_cache
.
clear
()
try
:
struct
=
sys
.
modules
[
'struct'
]
except
KeyError
:
pass
else
:
struct
.
_clearcache
()
try
:
doctest
=
sys
.
modules
[
'doctest'
]
except
KeyError
:
pass
else
:
doctest
.
master
=
None
try
:
ctypes
=
sys
.
modules
[
'ctypes'
]
except
KeyError
:
pass
pass
else
:
else
:
ctypes
.
_reset_cache
()
ctypes
.
_reset_cache
()
...
...
Misc/NEWS
Dosyayı görüntüle @
ac33bd7d
...
@@ -253,6 +253,8 @@ Documentation
...
@@ -253,6 +253,8 @@ Documentation
Tests
Tests
-----
-----
- Issue #23839: Various caches now are cleared before running every test file.
- Issue #27369: In test_pyexpat, avoid testing an error message detail that
- Issue #27369: In test_pyexpat, avoid testing an error message detail that
changed in Expat 2.2.0.
changed in Expat 2.2.0.
...
...
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