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
fcafe433
Kaydet (Commit)
fcafe433
authored
Kas 24, 2013
tarafından
Larry Hastings
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix inspect.signature tests for builtins when docstrings are compiled out.
üst
3b7b1e53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
test_capi.py
Lib/test/test_capi.py
+3
-0
test_inspect.py
Lib/test/test_inspect.py
+6
-1
No files found.
Lib/test/test_capi.py
Dosyayı görüntüle @
fcafe433
...
@@ -9,6 +9,7 @@ import sys
...
@@ -9,6 +9,7 @@ import sys
import
time
import
time
import
unittest
import
unittest
from
test
import
support
from
test
import
support
from
test.support
import
MISSING_C_DOCSTRINGS
try
:
try
:
import
_posixsubprocess
import
_posixsubprocess
except
ImportError
:
except
ImportError
:
...
@@ -109,6 +110,8 @@ class CAPITest(unittest.TestCase):
...
@@ -109,6 +110,8 @@ class CAPITest(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
_posixsubprocess
.
fork_exec
,
self
.
assertRaises
(
TypeError
,
_posixsubprocess
.
fork_exec
,
Z
(),[
b
'1'
],
3
,[
1
,
2
],
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
)
Z
(),[
b
'1'
],
3
,[
1
,
2
],
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
)
@unittest.skipIf
(
MISSING_C_DOCSTRINGS
,
"Signature information for builtins requires docstrings"
)
def
test_docstring_signature_parsing
(
self
):
def
test_docstring_signature_parsing
(
self
):
self
.
assertEqual
(
_testcapi
.
no_docstring
.
__doc__
,
None
)
self
.
assertEqual
(
_testcapi
.
no_docstring
.
__doc__
,
None
)
...
...
Lib/test/test_inspect.py
Dosyayı görüntüle @
fcafe433
...
@@ -17,6 +17,7 @@ except ImportError:
...
@@ -17,6 +17,7 @@ except ImportError:
ThreadPoolExecutor
=
None
ThreadPoolExecutor
=
None
from
test.support
import
run_unittest
,
TESTFN
,
DirsOnSysPath
from
test.support
import
run_unittest
,
TESTFN
,
DirsOnSysPath
from
test.support
import
MISSING_C_DOCSTRINGS
from
test.script_helper
import
assert_python_ok
,
assert_python_failure
from
test.script_helper
import
assert_python_ok
,
assert_python_failure
from
test
import
inspect_fodder
as
mod
from
test
import
inspect_fodder
as
mod
from
test
import
inspect_fodder2
as
mod2
from
test
import
inspect_fodder2
as
mod2
...
@@ -1579,7 +1580,7 @@ class TestSignatureObject(unittest.TestCase):
...
@@ -1579,7 +1580,7 @@ class TestSignatureObject(unittest.TestCase):
(
'kwargs'
,
...
,
int
,
"var_keyword"
)),
(
'kwargs'
,
...
,
int
,
"var_keyword"
)),
...
))
...
))
def
test_signature_on_
builtin_function
(
self
):
def
test_signature_on_
unsupported_builtins
(
self
):
with
self
.
assertRaisesRegex
(
ValueError
,
'not supported by signature'
):
with
self
.
assertRaisesRegex
(
ValueError
,
'not supported by signature'
):
inspect
.
signature
(
type
)
inspect
.
signature
(
type
)
with
self
.
assertRaisesRegex
(
ValueError
,
'not supported by signature'
):
with
self
.
assertRaisesRegex
(
ValueError
,
'not supported by signature'
):
...
@@ -1588,6 +1589,10 @@ class TestSignatureObject(unittest.TestCase):
...
@@ -1588,6 +1589,10 @@ class TestSignatureObject(unittest.TestCase):
with
self
.
assertRaisesRegex
(
ValueError
,
'not supported by signature'
):
with
self
.
assertRaisesRegex
(
ValueError
,
'not supported by signature'
):
# support for 'method-wrapper'
# support for 'method-wrapper'
inspect
.
signature
(
min
.
__call__
)
inspect
.
signature
(
min
.
__call__
)
@unittest.skipIf
(
MISSING_C_DOCSTRINGS
,
"Signature information for builtins requires docstrings"
)
def
test_signature_on_builtins
(
self
):
self
.
assertEqual
(
inspect
.
signature
(
min
),
None
)
self
.
assertEqual
(
inspect
.
signature
(
min
),
None
)
signature
=
inspect
.
signature
(
os
.
stat
)
signature
=
inspect
.
signature
(
os
.
stat
)
self
.
assertTrue
(
isinstance
(
signature
,
inspect
.
Signature
))
self
.
assertTrue
(
isinstance
(
signature
,
inspect
.
Signature
))
...
...
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