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
e05e6b00
Kaydet (Commit)
e05e6b00
authored
Ock 29, 2007
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add a test for slicing an exception.
üst
af3d6270
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
test_exceptions.py
Lib/test/test_exceptions.py
+7
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_exceptions.py
Dosyayı görüntüle @
e05e6b00
...
@@ -296,6 +296,13 @@ class ExceptionTests(unittest.TestCase):
...
@@ -296,6 +296,13 @@ class ExceptionTests(unittest.TestCase):
'pickled "
%
r", attribute "
%
s'
%
'pickled "
%
r", attribute "
%
s'
%
(
e
,
checkArgName
))
(
e
,
checkArgName
))
def
testSlicing
(
self
):
# Test that you can slice an exception directly instead of requiring
# going through the 'args' attribute.
args
=
(
1
,
2
,
3
)
exc
=
BaseException
(
*
args
)
self
.
failUnlessEqual
(
exc
[:],
args
)
def
testKeywordArgs
(
self
):
def
testKeywordArgs
(
self
):
# test that builtin exception don't take keyword args,
# test that builtin exception don't take keyword args,
# but user-defined subclasses can if they want
# but user-defined subclasses can if they want
...
...
Misc/NEWS
Dosyayı görüntüle @
e05e6b00
...
@@ -403,6 +403,8 @@ Extension Modules
...
@@ -403,6 +403,8 @@ Extension Modules
Tests
Tests
-----
-----
- Added a test for slicing of an exception.
- Added test.test_support.EnvironmentVarGuard. It'
s
a
class
that
provides
a
- Added test.test_support.EnvironmentVarGuard. It'
s
a
class
that
provides
a
context
manager
so
that
one
can
temporarily
set
or
unset
environment
context
manager
so
that
one
can
temporarily
set
or
unset
environment
variables
.
variables
.
...
...
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