Typing support for `settings` fixture?
I couldn't find a documented way to type the settings fixture, but from digging through the source code, it looks like the pytest_django.fixtures.SettingsWrapper class is the most accurate choice.
I noticed that previously some of the fixtures were exposed for the purposes of typing, such as DjangoAssertNumQueries: https://github.com/pytest-dev/pytest-django/commit/16ee779d7abeb77e91bc98e9e3ea78f98c3a5d76.
Is there a particular reason settings was left out? Is there a recommended way to type annotate this?
If it's just a case of applying a similar change to the commit above, I'm happy to contribute a PR.
PRs welcome!
Is there a preference for the public API?
The simplest choice looks like just adding SettingsWrapper to pytest_django.__init__.__all__, but the name feels a little unexpected. I think as a user of this library I'd expect the type annotation to look like one of the following:
def test_something(settings: SettingsFixture):
...
def test_something(settings: Settings):
...
Right now, I can import SettingsWrapper from pytest_django.fixtures directly, but this doesn't appear to follow the standard import pattern.
If you're happy with either Settings/SettingsFixture as the way forward, I'll work on a PR.
Does it work with SettingsWrapper?