Skip to content

Commit dcdd176

Browse files
committed
Run tests with macros and without experimental inspect
We are currently not testing pyo3 with the `macros` feature enabled but without `full` enabled
1 parent 603a69a commit dcdd176

File tree

3 files changed

+4
-32
lines changed

3 files changed

+4
-32
lines changed

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ def _get_feature_sets() -> Tuple[Optional[str], ...]:
14941494
if is_rust_nightly():
14951495
features += ",nightly"
14961496

1497-
return (None, "abi3", features, f"abi3,{features}")
1497+
return (None, "abi3", "macros", "abi3,macros", features, f"abi3,{features}")
14981498

14991499

15001500
_RELEASE_LINE_START = "release: "

tests/test_compile_error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ fn test_compile_errors() {
99
#[cfg(not(feature = "experimental-inspect"))]
1010
t.compile_fail("tests/ui/invalid_property_args.rs");
1111
t.compile_fail("tests/ui/invalid_proto_pymethods.rs");
12+
#[cfg(not(feature = "experimental-inspect"))]
1213
#[cfg(not(all(Py_LIMITED_API, not(Py_3_10))))] // to avoid PyFunctionArgument for &str
1314
t.compile_fail("tests/ui/invalid_pyclass_args.rs");
1415
t.compile_fail("tests/ui/invalid_pyclass_doc.rs");

tests/ui/invalid_pyclass_args.stderr

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -192,35 +192,6 @@ error[E0119]: conflicting implementations of trait `PyClassNewTextSignature` for
192192
|
193193
= note: this error originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)
194194

195-
error[E0277]: `Box<dyn std::error::Error + Send + Sync>` cannot be used as a Python function argument
196-
--> tests/ui/invalid_pyclass_args.rs:205:12
197-
|
198-
205 | field: Box<dyn std::error::Error + Send + Sync>,
199-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PyFunctionArgument<'_, '_, '_, false>` is not implemented for `Box<dyn std::error::Error + Send + Sync>`
200-
|
201-
= note: implement `FromPyObject` to enable using `Box<dyn std::error::Error + Send + Sync>` as a function argument
202-
= note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]`
203-
help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>`
204-
--> src/impl_/extract_argument.rs
205-
|
206-
| / impl<'a, 'holder, 'py, T: 'a + 'py> PyFunctionArgument<'a, 'holder, 'py, false>
207-
| | for &'holder Bound<'py, T>
208-
| | where
209-
| | T: PyTypeCheck,
210-
| |___________________^ `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
211-
...
212-
| / impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for Option<T>
213-
| | where
214-
| | T: PyFunctionArgument<'a, 'holder, 'py, false>,
215-
| |___________________________________________________^ `Option<T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
216-
...
217-
| impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> for &'holder T {
218-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
219-
...
220-
| / impl<'a, 'holder, T: PyClass<Frozen = False>> PyFunctionArgument<'a, 'holder, '_, false>
221-
| | for &'holder mut T
222-
| |______________________^ `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
223-
224195
error[E0592]: duplicate definitions with name `__pymethod___richcmp____`
225196
--> tests/ui/invalid_pyclass_args.rs:37:1
226197
|
@@ -456,11 +427,11 @@ error[E0277]: `Box<dyn std::error::Error + Send + Sync>` cannot be used as a Pyt
456427
--> tests/ui/invalid_pyclass_args.rs:205:12
457428
|
458429
205 | field: Box<dyn std::error::Error + Send + Sync>,
459-
| ^^^ the trait `pyo3::PyClass` is not implemented for `Box<dyn std::error::Error + Send + Sync>`
430+
| ^^^ the trait `PyClass` is not implemented for `Box<dyn std::error::Error + Send + Sync>`
460431
|
461432
= note: implement `FromPyObject` to enable using `Box<dyn std::error::Error + Send + Sync>` as a function argument
462433
= note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]`
463-
= help: the following other types implement trait `pyo3::PyClass`:
434+
= help: the following other types implement trait `PyClass`:
464435
Coord
465436
Coord2
466437
Coord3

0 commit comments

Comments
 (0)