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
9f545c48
Kaydet (Commit)
9f545c48
authored
May 09, 2003
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make this format again.
üst
a30dffbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
libtest.tex
Doc/lib/libtest.tex
+12
-10
No files found.
Doc/lib/libtest.tex
Dosyayı görüntüle @
9f545c48
...
...
@@ -29,13 +29,14 @@ testing style; these styles of tests will not be covered.
\end{seealso}
\subsection
{
test
_
support
\label
{
test
_
support-docs
}}
The
\module
{
test
_
support
}
module contains functions for assisting with writing
regression tests.
\subsection
{
\module
[test.testsupport]
{
test.test
_
support
}
---
--- Utility functions for tests
}
\declaremodule
[test.testsupport]
{
standard
}{
test.test
_
support
}
The
\module
{
test.test
_
support
}
module contains functions for assisting
with writing regression tests.
The
\module
{
test
_
support
}
module defines the following exceptions:
The
\module
{
test
.test
_
support
}
module defines the following exceptions:
\begin{excdesc}
{
TestFailed
}
Exception to be raised when a test fails.
...
...
@@ -89,7 +90,7 @@ any byte-compiled files of the module.
Returns
\constant
{
True
}
if
\var
{
resource
}
is enabled and available.
The list of available resources is only set when
\module
{
regrtest.py
}
is
executing the tests.
\end{funcdes
t
}
\end{funcdes
c
}
\begin{funcdesc}
{
requires
}{
resource
\optional
{
, msg
}}
Raises
\exception
{
ResourceDenied
}
if
\var
{
resource
}
is not available.
...
...
@@ -110,7 +111,7 @@ Execute \class{unittest.TestCase} subclasses passed to the function.
The function scans the classes for methods starting with the name
\code
{
"test
_
"
}
and executes the tests individually.
This is the preferred way to execute tests.
\end{
data
desc}
\end{
func
desc}
\begin{funcdesc}
{
run
_
suite
}{
suite
\optional
{
, testclass=None
}}
Execute the
\class
{
unittest.TestSuite
}
instance,
\var
{
suite
}
.
...
...
@@ -121,17 +122,18 @@ originated from.
\subsection
{
Writing Unit Tests for the
\module
{
test
}
package
\label
{
writing-tests
}}
\subsection
{
Writing Unit Tests for the
\module
{
test
}
package
%
\label
{
writing-tests
}}
It is preferred that tests for the
\module
{
test
}
package use the
\module
{
unittest
}
module and follow a few guidelines.
\
ref
module
{
unittest
}
module and follow a few guidelines.
One is to have the name of all the test methods start with
\code
{
"test
_
"
}
as
well as the module's name.
This is needed so that the methods are recognized by the test driver as
test methods.
Also, no documentation string for the method should be included.
A comment (such as
\
var
{
# Tests function returns only True or False
}
) should be used to provide
\
code
{
\
#
Tests function returns only True or False
}
) should be used to provide
documentation for test methods.
This is done because documentation strings get printed out if they exist and
thus what test is being run is not stated.
...
...
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