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
352def0e
Kaydet (Commit)
352def0e
authored
Mar 27, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#17329: document unittest.SkipTest. Initial patch by Zachary Ware.
üst
23790b4b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
unittest.rst
Doc/library/unittest.rst
+10
-3
case.py
Lib/unittest/case.py
+1
-1
No files found.
Doc/library/unittest.rst
Dosyayı görüntüle @
352def0e
...
@@ -638,7 +638,7 @@ the test unless the passed object has a certain attribute::
...
@@ -638,7 +638,7 @@ the test unless the passed object has a certain attribute::
def skipUnlessHasattr(obj, attr):
def skipUnlessHasattr(obj, attr):
if hasattr(obj, attr):
if hasattr(obj, attr):
return lambda func: func
return lambda func: func
return unittest.skip("{
0!r} doesn't have {1
!r}".format(obj, attr))
return unittest.skip("{
!r} doesn't have {
!r}".format(obj, attr))
The following decorators implement test skipping and expected failures:
The following decorators implement test skipping and expected failures:
...
@@ -660,6 +660,13 @@ The following decorators implement test skipping and expected failures:
...
@@ -660,6 +660,13 @@ The following decorators implement test skipping and expected failures:
Mark the test as an expected failure. If the test fails when run, the test
Mark the test as an expected failure. If the test fails when run, the test
is not counted as a failure.
is not counted as a failure.
.. exception:: SkipTest(reason)
This exception is raised to skip a test.
Usually you can use :meth:`TestCase.skipTest` or one of the skipping
decorators instead of raising this directly.
Skipped tests will not have :meth:`setUp` or :meth:`tearDown` run around them.
Skipped tests will not have :meth:`setUp` or :meth:`tearDown` run around them.
Skipped classes will not have :meth:`setUpClass` or :meth:`tearDownClass` run.
Skipped classes will not have :meth:`setUpClass` or :meth:`tearDownClass` run.
...
@@ -1956,7 +1963,7 @@ then you must call up to them yourself. The implementations in
...
@@ -1956,7 +1963,7 @@ then you must call up to them yourself. The implementations in
If an exception is raised during a ``setUpClass`` then the tests in the class
If an exception is raised during a ``setUpClass`` then the tests in the class
are not run and the ``tearDownClass`` is not run. Skipped classes will not
are not run and the ``tearDownClass`` is not run. Skipped classes will not
have ``setUpClass`` or ``tearDownClass`` run. If the exception is a
have ``setUpClass`` or ``tearDownClass`` run. If the exception is a
``SkipTest`
` exception then the class will be reported as having been skipped
:exc:`SkipTest
` exception then the class will be reported as having been skipped
instead of as an error.
instead of as an error.
...
@@ -1973,7 +1980,7 @@ These should be implemented as functions::
...
@@ -1973,7 +1980,7 @@ These should be implemented as functions::
If an exception is raised in a ``setUpModule`` then none of the tests in the
If an exception is raised in a ``setUpModule`` then none of the tests in the
module will be run and the ``tearDownModule`` will not be run. If the exception is a
module will be run and the ``tearDownModule`` will not be run. If the exception is a
``SkipTest`
` exception then the module will be reported as having been skipped
:exc:`SkipTest
` exception then the module will be reported as having been skipped
instead of as an error.
instead of as an error.
...
...
Lib/unittest/case.py
Dosyayı görüntüle @
352def0e
...
@@ -26,7 +26,7 @@ class SkipTest(Exception):
...
@@ -26,7 +26,7 @@ class SkipTest(Exception):
"""
"""
Raise this exception in a test to skip it.
Raise this exception in a test to skip it.
Usually you can use Test
Result.skip
() or one of the skipping decorators
Usually you can use Test
Case.skipTest
() or one of the skipping decorators
instead of raising this directly.
instead of raising this directly.
"""
"""
pass
pass
...
...
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