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
d98a6a01
Kaydet (Commit)
d98a6a01
authored
Şub 01, 2009
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move built-in loader tests to importlib.test.abc.LoaderTests.
üst
fa6cf39e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
NOTES
Lib/importlib/NOTES
+1
-2
test_loader.py
Lib/importlib/test/builtin/test_loader.py
+23
-3
No files found.
Lib/importlib/NOTES
Dosyayı görüntüle @
d98a6a01
to do
/////
* Use test.
loader_t
ests
* Use test.
abc.LoaderT
ests
+ builtin
+ frozen
+ extension
+ source
...
...
Lib/importlib/test/builtin/test_loader.py
Dosyayı görüntüle @
d98a6a01
import
importlib
from
importlib
import
machinery
from
..
import
abc
from
..
import
support
import
sys
...
...
@@ -7,7 +8,7 @@ import types
import
unittest
class
LoaderTests
(
unittest
.
TestCase
):
class
LoaderTests
(
abc
.
LoaderTests
):
"""Test load_module() for built-in modules."""
...
...
@@ -26,13 +27,32 @@ class LoaderTests(unittest.TestCase):
load_module
=
staticmethod
(
lambda
name
:
machinery
.
BuiltinImporter
.
load_module
(
name
))
def
test_
load_
module
(
self
):
def
test_module
(
self
):
# Common case.
with
support
.
uncache
(
self
.
name
):
module
=
self
.
load_module
(
self
.
name
)
self
.
verify
(
module
)
def
test_nonexistent
(
self
):
def
test_package
(
self
):
# Built-in modules cannot be a package.
pass
def
test_lacking_parent
(
self
):
# Built-in modules cannot be a package.
pass
def
test_state_after_failure
(
self
):
# Not way to force an imoprt failure.
pass
def
test_module_reuse
(
self
):
# Test that the same module is used in a reload.
with
support
.
uncache
(
self
.
name
):
module1
=
self
.
load_module
(
self
.
name
)
module2
=
self
.
load_module
(
self
.
name
)
self
.
assert_
(
module1
is
module2
)
def
test_unloadable
(
self
):
name
=
'dssdsdfff'
assert
name
not
in
sys
.
builtin_module_names
self
.
assertRaises
(
ImportError
,
self
.
load_module
,
name
)
...
...
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