pyo3/tests
Chris Laplante 3b94f4b70c
Add `anyhow-integration` feature which implements From<anyhow::Error> for PyErr (#1822)
* Add 'anyhow' feature which provides simple From<anyhow::Error> for PyErr impl

This makes it possible to use anyhow::Result<T> as the return type for
methods and functions exposed to Python.

The current implementation just stringifies the anyhow::Error before
shoving it into a PyRuntimeError. Conversion back to the anyhow::Error
is not possible, but it is better than nothing.

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>

* Document `anyhow` feature in the guide

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>

* update changelog to document anyhow feature

* WIP adding tests

* Finish up anyhow feature

* Fix formatting

* Fix tests

* Fix tests

* Apply review suggestions

Co-authored-by: Bruno Kolenbrander <59372212+mejrs@users.noreply.github.com>
Co-authored-by: mejrs <brunokolenbrander@hotmail.com>
2021-10-17 07:54:29 +01:00
..
hygiene Fix import 2021-10-03 02:30:13 +02:00
not_msrv pyo3-macros-backend: support macros inside doc attributes 2021-08-28 22:47:20 +01:00
ui Fix additional tests after trybuild update 2021-10-11 20:52:24 -04:00
common.rs Extend py_run! macro to take dict as *d syntax 2021-03-14 16:33:49 +09:00
test_anyhow.rs Add `anyhow-integration` feature which implements From<anyhow::Error> for PyErr (#1822) 2021-10-17 07:54:29 +01:00
test_arithmetics.rs pymethods: disable protocols with multiple-pymethods for now 2021-09-18 13:08:24 +01:00
test_arithmetics_protos.rs pymethods: support inplace numerical operations 2021-09-17 08:13:54 +01:00
test_buffer.rs ffi: use _Py_NewRef for clarity 2021-09-29 08:02:08 +01:00
test_buffer_protocol.rs ffi: use _Py_NewRef for clarity 2021-09-29 08:02:08 +01:00
test_bytes.rs Add `wrap_pyfunction` macro to prelude 2021-06-24 22:34:55 +08:00
test_class_attributes.rs tests: fix new clippy warning (does not like Foo::foo) 2021-08-23 15:47:09 +02:00
test_class_basics.rs pyclass: allow `#[pyo3(get, set, name = "foo")]` 2021-06-04 11:30:40 +01:00
test_class_conversion.rs Proof of concept of using PEP384s PyType_Spec 2020-09-02 16:54:39 -04:00
test_class_new.rs Use Python::with_gil and py_assert 2021-03-19 10:17:06 +08:00
test_compile_error.rs chore: update rust 1.55 (#1865) 2021-09-12 18:07:24 +01:00
test_datetime.rs rust: updates for rust & clippy 1.54 2021-07-31 08:19:38 +01:00
test_dict_iter.rs Address clippy::unreadable_literal issues 2019-08-17 14:10:35 +02:00
test_dunder.rs pyproto: deprecate py_methods 2021-04-20 00:21:19 +01:00
test_exceptions.rs Add `wrap_pyfunction` macro to prelude 2021-06-24 22:34:55 +08:00
test_frompyobject.rs pep 604: use `T | U` instead of `Union[T, U]` in messaging 2021-09-24 22:46:25 +01:00
test_gc.rs Fix clippy warnings in Rust 1.51.0 2021-03-26 13:21:38 +08:00
test_getter_setter.rs macros: raise AttributeError on property deletion requests 2021-08-13 21:01:00 -07:00
test_hygiene.rs Skip pymethods hygiene on `multiple-pymethods` 2021-10-03 01:41:22 +02:00
test_inheritance.rs pyclass: refactor initialization, call native type dealloc 2021-06-23 07:45:51 +01:00
test_macros.rs Add `wrap_pyfunction` macro to prelude 2021-06-24 22:34:55 +08:00
test_mapping.rs pyproto: deprecate py_methods 2021-04-20 00:21:19 +01:00
test_methods.rs Add a test 2021-06-25 00:18:53 +02:00
test_module.rs macros-backend: don't error on #[doc(hidden)] 2021-07-08 23:41:24 +01:00
test_multiple_pymethods.rs pymethods: make inventory optional 2021-03-04 19:52:58 +00:00
test_not_msrv.rs pyo3-macros-backend: support macros inside doc attributes 2021-08-28 22:47:20 +01:00
test_proto_methods.rs pymethods: fix support for MSRV 2021-09-18 16:42:02 +01:00
test_py36_init.rs gil: try to initialize threads on Python 3.6 if possible 2021-09-17 08:48:21 +01:00
test_pyfunction.rs Add `wrap_pyfunction` macro to prelude 2021-06-24 22:34:55 +08:00
test_pyself.rs rust 1.50: clippy and lint fixes 2021-02-11 22:03:34 +00:00
test_sequence.rs Refactor tests to use shorter macros 2021-03-14 23:43:53 +09:00
test_serde.rs implement Serialize, Deserialize for Py<T> 2021-01-11 22:19:10 +00:00
test_string.rs Add `wrap_pyfunction` macro to prelude 2021-06-24 22:34:55 +08:00
test_text_signature.rs Add `wrap_pyfunction` macro to prelude 2021-06-24 22:34:55 +08:00
test_unsendable_dict.rs abi3: add support for dict and weakref from Python 3.9 2020-12-28 10:22:46 +00:00
test_variable_arguments.rs rust 1.50: clippy and lint fixes 2021-02-11 22:03:34 +00:00
test_various.rs Add `wrap_pyfunction` macro to prelude 2021-06-24 22:34:55 +08:00
test_wrap_pyfunction_deduction.rs Add `wrap_pyfunction` macro to prelude 2021-06-24 22:34:55 +08:00