Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
ab323e04
Commit
ab323e04
authored
Jun 05, 2020
by
Sergei Izmailov
Committed by
Wenzel Jakob
Jun 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test py::iterable/py::iterator representation in docstrings
parent
4f1531c4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
tests/test_pytypes.cpp
+4
-0
tests/test_pytypes.py
+10
-0
No files found.
tests/test_pytypes.cpp
View file @
ab323e04
...
@@ -13,6 +13,10 @@
...
@@ -13,6 +13,10 @@
TEST_SUBMODULE
(
pytypes
,
m
)
{
TEST_SUBMODULE
(
pytypes
,
m
)
{
// test_int
// test_int
m
.
def
(
"get_int"
,
[]{
return
py
::
int_
(
0
);});
m
.
def
(
"get_int"
,
[]{
return
py
::
int_
(
0
);});
// test_iterator
m
.
def
(
"get_iterator"
,
[]{
return
py
::
iterator
();});
// test_iterable
m
.
def
(
"get_iterable"
,
[]{
return
py
::
iterable
();});
// test_list
// test_list
m
.
def
(
"get_list"
,
[]()
{
m
.
def
(
"get_list"
,
[]()
{
py
::
list
list
;
py
::
list
list
;
...
...
tests/test_pytypes.py
View file @
ab323e04
...
@@ -5,9 +5,19 @@ import sys
...
@@ -5,9 +5,19 @@ import sys
from
pybind11_tests
import
pytypes
as
m
from
pybind11_tests
import
pytypes
as
m
from
pybind11_tests
import
debug_enabled
from
pybind11_tests
import
debug_enabled
def
test_int
(
doc
):
def
test_int
(
doc
):
assert
doc
(
m
.
get_int
)
==
"get_int() -> int"
assert
doc
(
m
.
get_int
)
==
"get_int() -> int"
def
test_iterator
(
doc
):
assert
doc
(
m
.
get_iterator
)
==
"get_iterator() -> Iterator"
def
test_iterable
(
doc
):
assert
doc
(
m
.
get_iterable
)
==
"get_iterable() -> Iterable"
def
test_list
(
capture
,
doc
):
def
test_list
(
capture
,
doc
):
with
capture
:
with
capture
:
lst
=
m
.
get_list
()
lst
=
m
.
get_list
()
...
...
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