Author: Antonio Cuni <[email protected]>
Branch: hpy
Changeset: r98093:513f66555585
Date: 2019-11-17 01:14 +0100
http://bitbucket.org/pypy/pypy/changeset/513f66555585/
Log: import this test, which already passes :)
diff --git a/pypy/module/hpy_universal/test/test_basic.py
b/pypy/module/hpy_universal/test/test_basic.py
--- a/pypy/module/hpy_universal/test/test_basic.py
+++ b/pypy/module/hpy_universal/test/test_basic.py
@@ -65,3 +65,27 @@
""")
x = object()
assert mod.f(x) is x
+
+ def test_wrong_number_of_arguments(self):
+ # XXX: this test was manually modified to turn pytest.raises into
raises :(
+ mod = self.make_module("""
+ HPy_FUNCTION(f_noargs)
+ static HPy f_noargs_impl(HPyContext ctx, HPy self, HPy args)
+ {
+ return HPyNone_Get(ctx);
+ }
+ HPy_FUNCTION(f_o)
+ static HPy f_o_impl(HPyContext ctx, HPy self, HPy args)
+ {
+ return HPyNone_Get(ctx);
+ }
+ @EXPORT f_noargs METH_NOARGS
+ @EXPORT f_o METH_O
+ @INIT
+ """)
+ with raises(TypeError):
+ mod.f_noargs(1)
+ with raises(TypeError):
+ mod.f_o()
+ with raises(TypeError):
+ mod.f_o(1, 2)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit