Skip to content

Commit 9ae31f2

Browse files
committed
fix tests
1 parent a9b98b7 commit 9ae31f2

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

src/test_hygiene/pymethods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ impl Dummy {
644644

645645
fn __imod__(&mut self, _other: &Self) {}
646646

647-
fn __ipow__(&mut self, _other: &Self) {}
647+
fn __ipow__(&mut self, _other: &Self, _modulo: ::std::option::Option<u32>) {}
648648
fn __ilshift__(&mut self, other: &Self) {}
649649

650650
fn __irshift__(&mut self, other: &Self) {}

tests/test_compile_error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fn _test_compile_errors() {
3131
t.compile_fail("tests/ui/reject_generics.rs");
3232
t.compile_fail("tests/ui/not_send.rs");
3333
t.compile_fail("tests/ui/invalid_pymethod_proto_args.rs");
34+
t.compile_fail("tests/ui/invalid_pymethod_proto_args_py.rs");
3435

3536
tests_rust_1_49(&t);
3637
tests_rust_1_55(&t);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use pyo3::prelude::*;
2+
3+
#[pyclass]
4+
struct MyClass {}
5+
6+
#[pymethods]
7+
impl MyClass {
8+
fn __truediv__(&self, _py: Python) -> PyResult<()> {
9+
Ok(())
10+
}
11+
}
12+
13+
fn main() {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
error: Expected 1 arguments, got 0
2+
--> tests/ui/invalid_pymethod_proto_args_py.rs:8:8
3+
|
4+
8 | fn __truediv__(&self, _py: Python) -> PyResult<()> {
5+
| ^^^^^^^^^^^

0 commit comments

Comments
 (0)