Replace the deprecated `pytest.warns(None)` with the suggested
replacement (from https://github.com/pytest-dev/pytest/issues/9404)
to make the test suite forward compatible with pytest-8. This works
correctly with pytest-6 as well.
* Add test
* To run the workflow
* Fix import
* Format
* Add warning
* Fix indentation
* Test deprecated method
* More test
* Format
* Add import if needed
---------
Co-authored-by: Adrien Vannson <adrien.vannson@gardacp.com>
This change ensures that deprecation warnings are only raised when
either a deprecated field is explicitly set or a deprecated message is
initialised.
Resolves: #347