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
554290d9
Kaydet (Commit)
554290d9
authored
Haz 12, 2009
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixup/simplify another nested context manager.
üst
680bf1af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
test_meta_path.py
Lib/importlib/test/import_/test_meta_path.py
+3
-6
No files found.
Lib/importlib/test/import_/test_meta_path.py
Dosyayı görüntüle @
554290d9
from
..
import
util
from
..
import
util
from
.
import
util
as
import_util
from
.
import
util
as
import_util
from
contextlib
import
nested
from
types
import
MethodType
from
types
import
MethodType
import
unittest
import
unittest
...
@@ -18,8 +17,7 @@ class CallingOrder(unittest.TestCase):
...
@@ -18,8 +17,7 @@ class CallingOrder(unittest.TestCase):
mod
=
'top_level'
mod
=
'top_level'
first
=
util
.
mock_modules
(
mod
)
first
=
util
.
mock_modules
(
mod
)
second
=
util
.
mock_modules
(
mod
)
second
=
util
.
mock_modules
(
mod
)
context
=
nested
(
util
.
mock_modules
(
mod
),
util
.
mock_modules
(
mod
))
with
util
.
mock_modules
(
mod
)
as
first
,
util
.
mock_modules
(
mod
)
as
second
:
with
context
as
(
first
,
second
):
first
.
modules
[
mod
]
=
42
first
.
modules
[
mod
]
=
42
second
.
modules
[
mod
]
=
-
13
second
.
modules
[
mod
]
=
-
13
with
util
.
import_state
(
meta_path
=
[
first
,
second
]):
with
util
.
import_state
(
meta_path
=
[
first
,
second
]):
...
@@ -28,9 +26,8 @@ class CallingOrder(unittest.TestCase):
...
@@ -28,9 +26,8 @@ class CallingOrder(unittest.TestCase):
def
test_continuing
(
self
):
def
test_continuing
(
self
):
# [continuing]
# [continuing]
mod_name
=
'for_real'
mod_name
=
'for_real'
first
=
util
.
mock_modules
(
'nonexistent'
)
with
util
.
mock_modules
(
'nonexistent'
)
as
first
,
\
second
=
util
.
mock_modules
(
mod_name
)
util
.
mock_modules
(
mod_name
)
as
second
:
with
nested
(
first
,
second
):
first
.
find_module
=
lambda
self
,
fullname
,
path
=
None
:
None
first
.
find_module
=
lambda
self
,
fullname
,
path
=
None
:
None
second
.
modules
[
mod_name
]
=
42
second
.
modules
[
mod_name
]
=
42
with
util
.
import_state
(
meta_path
=
[
first
,
second
]):
with
util
.
import_state
(
meta_path
=
[
first
,
second
]):
...
...
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