2 from pybind11_tests
import modules
as m
3 from pybind11_tests.modules
import subsubmodule
as ms
4 from pybind11_tests
import ConstructorStats
9 assert pybind11_tests.__name__ ==
"pybind11_tests" 10 assert pybind11_tests.modules.__name__ ==
"pybind11_tests.modules" 11 assert pybind11_tests.modules.subsubmodule.__name__ ==
"pybind11_tests.modules.subsubmodule" 12 assert m.__name__ ==
"pybind11_tests.modules" 13 assert ms.__name__ ==
"pybind11_tests.modules.subsubmodule" 15 assert ms.submodule_func() ==
"submodule_func()" 20 assert str(b.get_a1()) ==
"A[1]" 21 assert str(b.a1) ==
"A[1]" 22 assert str(b.get_a2()) ==
"A[2]" 23 assert str(b.a2) ==
"A[2]" 27 assert str(b.get_a1()) ==
"A[42]" 28 assert str(b.a1) ==
"A[42]" 29 assert str(b.get_a2()) ==
"A[43]" 30 assert str(b.a2) ==
"A[43]" 33 assert astats.alive() == 2
34 assert bstats.alive() == 1
36 assert astats.alive() == 0
37 assert bstats.alive() == 0
38 assert astats.values() == [
'1',
'2',
'42',
'43']
39 assert bstats.values() == []
40 assert astats.default_constructions == 0
41 assert bstats.default_constructions == 1
42 assert astats.copy_constructions == 0
43 assert bstats.copy_constructions == 0
46 assert astats.copy_assignments == 2
47 assert bstats.copy_assignments == 0
48 assert astats.move_assignments == 0
49 assert bstats.move_assignments == 0
53 from pybind11_tests.modules
import OD
54 from collections
import OrderedDict
56 assert OD
is OrderedDict
57 assert str(OD([(1,
'a'), (2,
'b')])) ==
"OrderedDict([(1, 'a'), (2, 'b')])" 61 """Pydoc needs to be able to provide help() for everything inside a pybind11 module""" 65 assert pybind11_tests.__name__ ==
"pybind11_tests" 66 assert pybind11_tests.__doc__ ==
"pybind11 test module" 67 assert pydoc.text.docmodule(pybind11_tests)
71 """Registering two things with the same name""" 73 assert m.duplicate_registration() == []
def test_reference_internal()
static ConstructorStats & get(std::type_index type)
def test_nested_modules()
def test_duplicate_registration()