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
f2c4ba12
Kaydet (Commit)
f2c4ba12
authored
Tem 07, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #19593: Use specific asserts in importlib tests.
üst
cde9d1ee
344f8316
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
test_import.py
Lib/test/test_import.py
+3
-3
test_loader.py
Lib/test/test_importlib/builtin/test_loader.py
+1
-1
test_fromlist.py
Lib/test/test_importlib/import_/test_fromlist.py
+1
-1
test_meta_path.py
Lib/test/test_importlib/import_/test_meta_path.py
+1
-1
test_abc.py
Lib/test/test_importlib/test_abc.py
+1
-1
No files found.
Lib/test/test_import.py
Dosyayı görüntüle @
f2c4ba12
...
...
@@ -190,12 +190,12 @@ class ImportTests(unittest.TestCase):
# import x.y.z binds x in the current namespace
import
test
as
x
import
test.support
self
.
assert
True
(
x
is
test
,
x
.
__name__
)
self
.
assert
Is
(
x
,
test
,
x
.
__name__
)
self
.
assertTrue
(
hasattr
(
test
.
support
,
"__file__"
))
# import x.y.z as w binds z as w
import
test.support
as
y
self
.
assert
True
(
y
is
test
.
support
,
y
.
__name__
)
self
.
assert
Is
(
y
,
test
.
support
,
y
.
__name__
)
def
test_failing_reload
(
self
):
# A failing reload should leave the module object in sys.modules.
...
...
@@ -223,7 +223,7 @@ class ImportTests(unittest.TestCase):
self
.
assertRaises
(
ZeroDivisionError
,
importlib
.
reload
,
mod
)
# But we still expect the module to be in sys.modules.
mod
=
sys
.
modules
.
get
(
TESTFN
)
self
.
assertIsNot
(
mod
,
None
,
"expected module to be in sys.modules"
)
self
.
assertIsNot
None
(
mod
,
"expected module to be in sys.modules"
)
# We should have replaced a w/ 10, but the old b value should
# stick.
...
...
Lib/test/test_importlib/builtin/test_loader.py
Dosyayı görüntüle @
f2c4ba12
...
...
@@ -88,7 +88,7 @@ class InspectLoaderTests:
def
test_is_package
(
self
):
# Cannot be a package.
result
=
self
.
machinery
.
BuiltinImporter
.
is_package
(
util
.
BUILTINS
.
good_name
)
self
.
assert
True
(
not
result
)
self
.
assert
False
(
result
)
@unittest.skipIf
(
util
.
BUILTINS
.
bad_name
is
None
,
'all modules are built in'
)
def
test_not_builtin
(
self
):
...
...
Lib/test/test_importlib/import_/test_fromlist.py
Dosyayı görüntüle @
f2c4ba12
...
...
@@ -62,7 +62,7 @@ class HandlingFromlist:
with
util
.
import_state
(
meta_path
=
[
importer
]):
module
=
self
.
__import__
(
'module'
,
fromlist
=
[
'non_existent'
])
self
.
assertEqual
(
module
.
__name__
,
'module'
)
self
.
assert
True
(
not
hasattr
(
module
,
'non_existent'
))
self
.
assert
False
(
hasattr
(
module
,
'non_existent'
))
def
test_module_from_package
(
self
):
# [module]
...
...
Lib/test/test_importlib/import_/test_meta_path.py
Dosyayı görüntüle @
f2c4ba12
...
...
@@ -97,7 +97,7 @@ class CallSignature:
args
=
log
[
1
][
0
]
kwargs
=
log
[
1
][
1
]
# Assuming all arguments are positional.
self
.
assert
True
(
not
kwargs
)
self
.
assert
False
(
kwargs
)
self
.
assertEqual
(
args
[
0
],
mod_name
)
self
.
assertIs
(
args
[
1
],
path
)
...
...
Lib/test/test_importlib/test_abc.py
Dosyayı görüntüle @
f2c4ba12
...
...
@@ -784,7 +784,7 @@ class SourceOnlyLoaderTests(SourceLoaderTestHarness):
warnings
.
simplefilter
(
'ignore'
,
DeprecationWarning
)
module
=
self
.
loader
.
load_module
(
self
.
name
)
self
.
verify_module
(
module
)
self
.
assert
True
(
not
hasattr
(
module
,
'__path__'
))
self
.
assert
False
(
hasattr
(
module
,
'__path__'
))
def
test_get_source_encoding
(
self
):
# Source is considered encoded in UTF-8 by default unless otherwise
...
...
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