Skip to content

Commit

Permalink
Bless ui test and pin clap
Browse files Browse the repository at this point in the history
  • Loading branch information
mejrs committed Apr 12, 2022
1 parent 54de029 commit 1f88c84
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ serde = { version = "1.0", optional = true }
assert_approx_eq = "1.1.0"
# O.3.5 uses the matches! macro, which isn't compatible with Rust 1.41
criterion = "=0.3.4"
# 2.34 uses the matches! macro, which isn't compatible with Rust 1.41
clap = "=2.33"
# half and bitflags use if/match in const fn, which isn't compatible with Rust 1.41
half = "=1.7.1"
bitflags = "=1.2.1"
Expand Down
25 changes: 12 additions & 13 deletions tests/test_compile_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ fn _test_compile_errors() {
t.compile_fail("tests/ui/invalid_need_module_arg_position.rs");
t.compile_fail("tests/ui/invalid_property_args.rs");
t.compile_fail("tests/ui/invalid_pyclass_args.rs");
t.compile_fail("tests/ui/invalid_pyfunctions.rs");
t.compile_fail("tests/ui/invalid_pymethods.rs");
t.compile_fail("tests/ui/invalid_pymethod_names.rs");
t.compile_fail("tests/ui/invalid_argument_attributes.rs");
t.compile_fail("tests/ui/reject_generics.rs");

tests_rust_1_48(&t);
tests_rust_1_49(&t);
tests_rust_1_54(&t);
tests_rust_1_55(&t);
tests_rust_1_56(&t);
tests_rust_1_60(&t);

#[rustversion::since(1.48)]
fn tests_rust_1_48(t: &trybuild::TestCases) {
Expand All @@ -48,20 +45,11 @@ fn _test_compile_errors() {

#[rustversion::since(1.54)]
fn tests_rust_1_54(t: &trybuild::TestCases) {
t.compile_fail("tests/ui/invalid_frompy_derive.rs");
t.compile_fail("tests/ui/static_ref.rs");
}
#[rustversion::before(1.54)]
fn tests_rust_1_54(_t: &trybuild::TestCases) {}

#[rustversion::since(1.55)]
fn tests_rust_1_55(t: &trybuild::TestCases) {
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
}

#[rustversion::before(1.55)]
fn tests_rust_1_55(_t: &trybuild::TestCases) {}

#[rustversion::since(1.56)]
fn tests_rust_1_56(t: &trybuild::TestCases) {
t.compile_fail("tests/ui/invalid_closure.rs");
Expand All @@ -74,4 +62,15 @@ fn _test_compile_errors() {

#[rustversion::before(1.56)]
fn tests_rust_1_56(_t: &trybuild::TestCases) {}


#[rustversion::since(1.60)]
fn tests_rust_1_60(t: &trybuild::TestCases) {
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
t.compile_fail("tests/ui/invalid_argument_attributes.rs");
t.compile_fail("tests/ui/invalid_frompy_derive.rs");
}

#[rustversion::before(1.60)]
fn tests_rust_1_60(_t: &trybuild::TestCases) {}
}
4 changes: 2 additions & 2 deletions tests/ui/invalid_argument_attributes.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ error: expected `from_py_with`
| ^^^

error: expected `=`
--> tests/ui/invalid_argument_attributes.rs:7:32
--> tests/ui/invalid_argument_attributes.rs:7:45
|
7 | fn from_py_with_no_value(#[pyo3(from_py_with)] param: String) {}
| ^^^^^^^^^^^^^^
| ^

error: expected `from_py_with`
--> tests/ui/invalid_argument_attributes.rs:10:31
Expand Down
12 changes: 6 additions & 6 deletions tests/ui/invalid_frompy_derive.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ error: attribute name cannot be empty
| ^^

error: unexpected end of input, expected string literal
--> tests/ui/invalid_frompy_derive.rs:100:21
--> tests/ui/invalid_frompy_derive.rs:100:22
|
100 | #[pyo3(attribute())]
| ^^
| ^

error: expected at most one argument: `item` or `item(key)`
--> tests/ui/invalid_frompy_derive.rs:106:20
Expand All @@ -121,10 +121,10 @@ error: expected at most one argument: `item` or `item(key)`
| ^

error: unexpected end of input, expected literal
--> tests/ui/invalid_frompy_derive.rs:112:16
--> tests/ui/invalid_frompy_derive.rs:112:17
|
112 | #[pyo3(item())]
| ^^
| ^

error: only one of `attribute` or `item` can be provided
--> tests/ui/invalid_frompy_derive.rs:118:5
Expand Down Expand Up @@ -171,10 +171,10 @@ error: cannot derive FromPyObject for empty structs and variants
= note: this error originates in the derive macro `FromPyObject` (in Nightly builds, run with -Z macro-backtrace for more info)

error: expected `=`
--> tests/ui/invalid_frompy_derive.rs:158:11
--> tests/ui/invalid_frompy_derive.rs:158:24
|
158 | #[pyo3(from_py_with)]
| ^^^^^^^^^^^^^^
| ^

error: expected string literal
--> tests/ui/invalid_frompy_derive.rs:164:27
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/invalid_pymethod_receiver.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ error[E0277]: the trait bound `i32: From<&PyCell<MyClass>>` is not satisfied
<i32 as From<bool>>
<i32 as From<i16>>
<i32 as From<i8>>
and 2 others
and 71 others
= note: required because of the requirements on the impl of `Into<i32>` for `&PyCell<MyClass>`
= note: required because of the requirements on the impl of `TryFrom<&PyCell<MyClass>>` for `i32`

0 comments on commit 1f88c84

Please sign in to comment.