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
7d9e7215
Kaydet (Commit)
7d9e7215
authored
May 21, 2008
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
The -x <test1[,test2...]> flag allows to exclude tests.
üst
10cfc4b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
__init__.py
Lib/ctypes/test/__init__.py
+13
-5
No files found.
Lib/ctypes/test/__init__.py
Dosyayı görüntüle @
7d9e7215
...
@@ -50,11 +50,16 @@ def find_package_modules(package, mask):
...
@@ -50,11 +50,16 @@ def find_package_modules(package, mask):
if
fnmatch
.
fnmatchcase
(
fnm
,
mask
):
if
fnmatch
.
fnmatchcase
(
fnm
,
mask
):
yield
"
%
s.
%
s"
%
(
package
.
__name__
,
os
.
path
.
splitext
(
fnm
)[
0
])
yield
"
%
s.
%
s"
%
(
package
.
__name__
,
os
.
path
.
splitext
(
fnm
)[
0
])
def
get_tests
(
package
,
mask
,
verbosity
):
def
get_tests
(
package
,
mask
,
verbosity
,
exclude
):
"""Return a list of skipped test modules, and a list of test cases."""
"""Return a list of skipped test modules, and a list of test cases."""
tests
=
[]
tests
=
[]
skipped
=
[]
skipped
=
[]
for
modname
in
find_package_modules
(
package
,
mask
):
for
modname
in
find_package_modules
(
package
,
mask
):
if
modname
.
split
(
"."
)[
-
1
]
in
exclude
:
skipped
.
append
(
modname
)
if
verbosity
>
1
:
print
>>
sys
.
stderr
,
"Skipped
%
s: excluded"
%
modname
continue
try
:
try
:
mod
=
__import__
(
modname
,
globals
(),
locals
(),
[
'*'
])
mod
=
__import__
(
modname
,
globals
(),
locals
(),
[
'*'
])
except
ResourceDenied
,
detail
:
except
ResourceDenied
,
detail
:
...
@@ -151,12 +156,13 @@ class TestRunner(unittest.TextTestRunner):
...
@@ -151,12 +156,13 @@ class TestRunner(unittest.TextTestRunner):
def
main
(
*
packages
):
def
main
(
*
packages
):
try
:
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"rqvu:"
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"rqvu:
x:
"
)
except
getopt
.
error
:
except
getopt
.
error
:
return
usage
()
return
usage
()
verbosity
=
1
verbosity
=
1
search_leaks
=
False
search_leaks
=
False
exclude
=
[]
for
flag
,
value
in
opts
:
for
flag
,
value
in
opts
:
if
flag
==
"-q"
:
if
flag
==
"-q"
:
verbosity
-=
1
verbosity
-=
1
...
@@ -171,17 +177,19 @@ def main(*packages):
...
@@ -171,17 +177,19 @@ def main(*packages):
search_leaks
=
True
search_leaks
=
True
elif
flag
==
"-u"
:
elif
flag
==
"-u"
:
use_resources
.
extend
(
value
.
split
(
","
))
use_resources
.
extend
(
value
.
split
(
","
))
elif
flag
==
"-x"
:
exclude
.
append
(
value
.
split
(
","
))
mask
=
"test_*.py"
mask
=
"test_*.py"
if
args
:
if
args
:
mask
=
args
[
0
]
mask
=
args
[
0
]
for
package
in
packages
:
for
package
in
packages
:
run_tests
(
package
,
mask
,
verbosity
,
search_leaks
)
run_tests
(
package
,
mask
,
verbosity
,
search_leaks
,
exclude
)
def
run_tests
(
package
,
mask
,
verbosity
,
search_leaks
):
def
run_tests
(
package
,
mask
,
verbosity
,
search_leaks
,
exclude
):
skipped
,
testcases
=
get_tests
(
package
,
mask
,
verbosity
)
skipped
,
testcases
=
get_tests
(
package
,
mask
,
verbosity
,
exclude
)
runner
=
TestRunner
(
verbosity
=
verbosity
)
runner
=
TestRunner
(
verbosity
=
verbosity
)
suites
=
[
unittest
.
makeSuite
(
o
)
for
o
in
testcases
]
suites
=
[
unittest
.
makeSuite
(
o
)
for
o
in
testcases
]
...
...
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