Skip to content

Commit 1d27c7d

Browse files
laurensvalkdpgeorge
authored andcommitted
tests/misc: Add test for cexample module.
This also moves the existing test for cexample.add_ints originally done in extra_coverage. Signed-off-by: Laurens Valk <laurens@pybricks.com>
1 parent d75f49c commit 1d27c7d

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

tests/misc/cexample_module.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# test custom builtin module
2+
3+
try:
4+
import cexample
5+
except ImportError:
6+
print("SKIP")
7+
raise SystemExit
8+
9+
print(cexample)
10+
11+
d = dir(cexample)
12+
d.index("add_ints")
13+
14+
print(cexample.add_ints(1, 3))

tests/misc/cexample_module.py.exp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<module 'cexample'>
2+
4

tests/unix/extra_coverage.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@
4949
# function defined in C++ code
5050
print("cpp", extra_cpp_coverage())
5151

52-
# test user C module
53-
import cexample
54-
55-
print(cexample.add_ints(3, 2))
56-
5752
# test user C module mixed with C++ code
5853
import cppexample
5954

tests/unix/extra_coverage.py.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ OSError
179179
None
180180
None
181181
cpp None
182-
5
183182
(3, 'hellocpp')
184183
frzstr1
185184
frzstr1.py

0 commit comments

Comments
 (0)