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
4f82a037
Kaydet (Commit)
4f82a037
authored
Tem 24, 2007
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Tweak runpy test to do a better job of confirming that sys has been manipulated correctly
üst
ae21fc6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
test_runpy.py
Lib/test/test_runpy.py
+5
-3
No files found.
Lib/test/test_runpy.py
Dosyayı görüntüle @
4f82a037
...
...
@@ -21,8 +21,9 @@ class RunModuleCodeTest(unittest.TestCase):
"# Check the sys module
\n
"
"import sys
\n
"
"run_argv0 = sys.argv[0]
\n
"
"if __name__ in sys.modules:
\n
"
" run_name = sys.modules[__name__].__name__
\n
"
"run_name_in_sys_modules = __name__ in sys.modules
\n
"
"if run_name_in_sys_modules:
\n
"
" module_in_sys_modules = globals() is sys.modules[__name__].__dict__
\n
"
"# Check nested operation
\n
"
"import runpy
\n
"
"nested = runpy._run_module_code('x=1
\\
n', mod_name='<run>',
\n
"
...
...
@@ -48,7 +49,8 @@ class RunModuleCodeTest(unittest.TestCase):
self
.
failUnless
(
d2
[
"result"
]
==
self
.
expected_result
)
self
.
failUnless
(
d2
[
"nested"
][
"x"
]
==
1
)
self
.
failUnless
(
d2
[
"__name__"
]
is
name
)
self
.
failUnless
(
d2
[
"run_name"
]
is
name
)
self
.
failUnless
(
d2
[
"run_name_in_sys_modules"
])
self
.
failUnless
(
d2
[
"module_in_sys_modules"
])
self
.
failUnless
(
d2
[
"__file__"
]
is
file
)
self
.
failUnless
(
d2
[
"run_argv0"
]
is
file
)
self
.
failUnless
(
d2
[
"__loader__"
]
is
loader
)
...
...
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