[pytest-dev] pytest 5.0.0 and pluginmanager

Chris Dent cdent at anticdent.org
Mon Jul 1 07:07:27 EDT 2019



I maintain gabbi [1], a YAML driven HTTP API tester that dynamically
creates test cases in ordered suites. It was originally created to
work in a unittest/testtools/testrepository environment and then had
pytest support hacked in later. It does some shall we say unorthodox
things to work in both environments without requiring too much
manipulation or boilerplate from the person creating the tests.

One of those things is the use of late import of pytest and loading
of plugin to structure the tests:

https://github.com/cdent/gabbi/blob/149e046bd0bd42d283e4771c820fbae90273f4fb/gabbi/driver.py#L162-L164

That uses the now deprecated `pytest.config` global and I'm
struggling to determine how best to replace it without having to
make changes to the calling patterns that would break compatibility
with existing test installations.

This is the second implementation of gabbi+pytest. The first one
used yield tests (for which I gained a strong affection long ago).
The second was created to be compatible with existing deployed
tests. Now I find myself needing to adapt things again. If I can
continue to be compatible that would be great.

Any ideas?

[1] https://gabbi.readthedocs.io/ and https://github.com/cdent/gabbi

-- 
Chris Dent                       ٩◔̯◔۶           https://anticdent.org/
freenode: cdent


More information about the pytest-dev mailing list