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
76558e12
Kaydet (Commit)
76558e12
authored
Eki 06, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add regrtest check for caches in packaging.database (see #12167)
üst
1079bdfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
regrtest.py
Lib/test/regrtest.py
+24
-0
No files found.
Lib/test/regrtest.py
Dosyayı görüntüle @
76558e12
...
...
@@ -173,6 +173,7 @@ import io
import
json
import
logging
import
os
import
packaging.database
import
platform
import
random
import
re
...
...
@@ -967,6 +968,7 @@ class saved_test_environment:
'sys.warnoptions'
,
'threading._dangling'
,
'multiprocessing.process._dangling'
,
'sysconfig._CONFIG_VARS'
,
'sysconfig._SCHEMES'
,
'packaging.database_caches'
,
)
def
get_sys_argv
(
self
):
...
...
@@ -1054,6 +1056,28 @@ class saved_test_environment:
# Can't easily revert the logging state
pass
def
get_packaging_database_caches
(
self
):
# caching system used by the PEP 376 implementation
# we have one boolean and four dictionaries, initially empty
switch
=
packaging
.
database
.
_cache_enabled
saved
=
[]
for
name
in
(
'_cache_name'
,
'_cache_name_egg'
,
'_cache_path'
,
'_cache_path_egg'
):
cache
=
getattr
(
packaging
.
database
,
name
)
saved
.
append
((
id
(
cache
),
cache
,
cache
.
copy
()))
return
switch
,
saved
def
restore_packaging_database_caches
(
self
,
saved
):
switch
,
saved_caches
=
saved
packaging
.
database
.
_cache_enabled
=
switch
for
offset
,
name
in
enumerate
((
'_cache_name'
,
'_cache_name_egg'
,
'_cache_path'
,
'_cache_path_egg'
)):
_
,
cache
,
items
=
saved_caches
[
offset
]
# put back the same object in place
setattr
(
packaging
.
database
,
name
,
cache
)
# now restore its items
cache
.
clear
()
cache
.
update
(
items
)
def
get_sys_warnoptions
(
self
):
return
id
(
sys
.
warnoptions
),
sys
.
warnoptions
,
sys
.
warnoptions
[:]
def
restore_sys_warnoptions
(
self
,
saved_options
):
...
...
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