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
c5951fc9
Kaydet (Commit)
c5951fc9
authored
Agu 27, 2009
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make __package__ setting tests specific to importlib. Also move to assertRaises context manager.
üst
6d2bb7f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
test___package__.py
Lib/importlib/test/import_/test___package__.py
+5
-4
No files found.
Lib/importlib/test/import_/test___package__.py
Dosyayı görüntüle @
c5951fc9
...
...
@@ -56,15 +56,16 @@ class Using__package__(unittest.TestCase):
def
test_bad__package__
(
self
):
globals
=
{
'__package__'
:
'<not real>'
}
self
.
assertRaises
(
SystemError
,
import_util
.
import_
,
''
,
globals
,
{},
[
'relimport'
],
1
)
with
self
.
assertRaises
(
SystemError
):
import_util
.
import_
(
''
,
globals
,
{},
[
'relimport'
],
1
)
def
test_bunk__package__
(
self
):
globals
=
{
'__package__'
:
42
}
self
.
assertRaises
(
ValueError
,
import_util
.
import_
,
''
,
globals
,
{},
[
'relimport'
],
1
)
with
self
.
assertRaises
(
ValueError
):
import_util
.
import_
(
''
,
globals
,
{},
[
'relimport'
],
1
)
@import_util.importlib_only
class
Setting__package__
(
unittest
.
TestCase
):
"""Because __package__ is a new feature, it is not always set by a 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