Hi Chris, On Mon, Jul 1, 2019 at 8:17 AM Chris Dent <cd...@anticdent.org> wrote:
> > 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. > Is Gabbi + pytest a plugin? If so, you could store the config object during pytest_configure to reuse later: ``` _gabbi_pytest_config = None def pytest_configure(config): global _gabbi_pytest_config _gabbi_pytest_config = config def pytest_unconfigure(): global _gabbi_pytest_config _gabbi_pytest_config = None ``` This is basically what pytest did to provide the pytest.config global. This is more elegant if you can register this in a class of course. If you don't have a proper plugin, it is easy to write a small one even if only to get that global. > 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. > It should definitely be possible, with minimal effort. Let us know if we can help further. Cheers, Bruno;
_______________________________________________ pytest-dev mailing list pytest-dev@python.org https://mail.python.org/mailman/listinfo/pytest-dev