Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cd47b802
Commit
cd47b802
authored
Jun 27, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a trivial test of getargspec() with a method.
parent
ca016529
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
16 deletions
+21
-16
Lib/test/test_inspect.py
Lib/test/test_inspect.py
+21
-16
No files found.
Lib/test/test_inspect.py
View file @
cd47b802
...
@@ -152,22 +152,6 @@ test(inspect.getdoc(git.abuse) ==
...
@@ -152,22 +152,6 @@ test(inspect.getdoc(git.abuse) ==
test
(
inspect
.
getcomments
(
mod
.
StupidGit
)
==
'# line 20
\
n
'
,
test
(
inspect
.
getcomments
(
mod
.
StupidGit
)
==
'# line 20
\
n
'
,
'getcomments(mod.StupidGit)'
)
'getcomments(mod.StupidGit)'
)
args
,
varargs
,
varkw
,
defaults
=
inspect
.
getargspec
(
mod
.
eggs
)
test
(
args
==
[
'x'
,
'y'
],
'mod.eggs args'
)
test
(
varargs
==
None
,
'mod.eggs varargs'
)
test
(
varkw
==
None
,
'mod.eggs varkw'
)
test
(
defaults
==
None
,
'mod.eggs defaults'
)
test
(
inspect
.
formatargspec
(
args
,
varargs
,
varkw
,
defaults
)
==
'(x, y)'
,
'mod.eggs formatted argspec'
)
args
,
varargs
,
varkw
,
defaults
=
inspect
.
getargspec
(
mod
.
spam
)
test
(
args
==
[
'a'
,
'b'
,
'c'
,
'd'
,
[
'e'
,
[
'f'
]]],
'mod.spam args'
)
test
(
varargs
==
'g'
,
'mod.spam varargs'
)
test
(
varkw
==
'h'
,
'mod.spam varkw'
)
test
(
defaults
==
(
3
,
(
4
,
(
5
,))),
'mod.spam defaults'
)
test
(
inspect
.
formatargspec
(
args
,
varargs
,
varkw
,
defaults
)
==
'(a, b, c, d=3, (e, (f,))=(4, (5,)), *g, **h)'
,
'mod.spam formatted argspec'
)
git
.
abuse
(
7
,
8
,
9
)
git
.
abuse
(
7
,
8
,
9
)
istest
(
inspect
.
istraceback
,
'git.ex[2]'
)
istest
(
inspect
.
istraceback
,
'git.ex[2]'
)
...
@@ -365,3 +349,24 @@ test(('p', 'property', A) in attrs, 'missing property')
...
@@ -365,3 +349,24 @@ test(('p', 'property', A) in attrs, 'missing property')
test
((
'm'
,
'method'
,
B
)
in
attrs
,
'missing plain method'
)
test
((
'm'
,
'method'
,
B
)
in
attrs
,
'missing plain method'
)
test
((
'm1'
,
'method'
,
D
)
in
attrs
,
'missing plain method'
)
test
((
'm1'
,
'method'
,
D
)
in
attrs
,
'missing plain method'
)
test
((
'datablob'
,
'data'
,
A
)
in
attrs
,
'missing data'
)
test
((
'datablob'
,
'data'
,
A
)
in
attrs
,
'missing data'
)
args
,
varargs
,
varkw
,
defaults
=
inspect
.
getargspec
(
mod
.
eggs
)
test
(
args
==
[
'x'
,
'y'
],
'mod.eggs args'
)
test
(
varargs
==
None
,
'mod.eggs varargs'
)
test
(
varkw
==
None
,
'mod.eggs varkw'
)
test
(
defaults
==
None
,
'mod.eggs defaults'
)
test
(
inspect
.
formatargspec
(
args
,
varargs
,
varkw
,
defaults
)
==
'(x, y)'
,
'mod.eggs formatted argspec'
)
args
,
varargs
,
varkw
,
defaults
=
inspect
.
getargspec
(
mod
.
spam
)
test
(
args
==
[
'a'
,
'b'
,
'c'
,
'd'
,
[
'e'
,
[
'f'
]]],
'mod.spam args'
)
test
(
varargs
==
'g'
,
'mod.spam varargs'
)
test
(
varkw
==
'h'
,
'mod.spam varkw'
)
test
(
defaults
==
(
3
,
(
4
,
(
5
,))),
'mod.spam defaults'
)
test
(
inspect
.
formatargspec
(
args
,
varargs
,
varkw
,
defaults
)
==
'(a, b, c, d=3, (e, (f,))=(4, (5,)), *g, **h)'
,
'mod.spam formatted argspec'
)
args
,
varargs
,
varkw
,
defaults
=
inspect
.
getargspec
(
A
.
m
)
test
(
args
==
[
'self'
],
'A.m args'
)
test
(
varargs
is
None
,
'A.m varargs'
)
test
(
varkw
is
None
,
'A.m varkw'
)
test
(
defaults
is
None
,
'A.m defaults'
)
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