Skip to content

Commit 83f14f4

Browse files
committed
Adding UI test
1 parent 978c2f1 commit 83f14f4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/ui/invalid_pyclass_args.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,13 @@ struct InvalidOrderedStruct {
7676
inner: i32
7777
}
7878

79+
#[pyclass]
80+
struct Example {
81+
#[pyo3(foo)]
82+
#[pyo3(blah)]
83+
x: i32,
84+
#[pyo3(pop)]
85+
y: i32,
86+
}
87+
7988
fn main() {}

tests/ui/invalid_pyclass_args.stderr

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,20 @@ note: candidate #2 is defined in an impl for the type `HashOptAndManualHash`
221221
67 | #[pymethods]
222222
| ^^^^^^^^^^^^
223223
= note: this error originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)
224+
error: expected one of: `get`, `set`, `name`
225+
--> pytests/src/pyclasses.rs:7:12
226+
|
227+
81 | #[pyo3(foo)]
228+
| ^^^
229+
230+
error: expected one of: `get`, `set`, `name`
231+
--> pytests/src/pyclasses.rs:8:12
232+
|
233+
82 | #[pyo3(blah)]
234+
| ^^^^
235+
236+
error: expected one of: `get`, `set`, `name`
237+
--> pytests/src/pyclasses.rs:10:12
238+
|
239+
84 | #[pyo3(pop)]
240+
|

0 commit comments

Comments
 (0)