Relax asyncio_mode type definition; it allows to support pytest 6.1+#264
Relax asyncio_mode type definition; it allows to support pytest 6.1+#264
Conversation
seifertm
left a comment
There was a problem hiding this comment.
I don't think this is enough to support pytest 5.4. I set up a test project using code from this PR and pytest 5.4.3 which produces the following error:
$ pytest
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/tmp/venv/lib/python3.9/site-packages/_pytest/main.py", line 187, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File "/tmp/venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 820, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File "/tmp/venv/lib/python3.9/site-packages/pluggy/hooks.py", line 308, in call_historic
INTERNALERROR> res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/tmp/venv/lib/python3.9/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/tmp/venv/lib/python3.9/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR> File "/tmp/venv/lib/python3.9/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/tmp/venv/lib/python3.9/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/tmp/venv/lib/python3.9/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/tmp/venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py", line 111, in pytest_configure
INTERNALERROR> config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)
INTERNALERROR> AttributeError: 'Config' object has no attribute 'issue_config_time_warning'
I'm not opposed to raising the minimum required pytest version. Currently we seem to require at least pytest 6.1.
|
Uuups. Thanks for cross-checking. |
Codecov Report
@@ Coverage Diff @@
## master #264 +/- ##
=======================================
Coverage 93.12% 93.12%
=======================================
Files 3 3
Lines 262 262
Branches 33 33
=======================================
Hits 244 244
Misses 12 12
Partials 6 6
Continue to review full report at Codecov.
|
asvetlov
left a comment
There was a problem hiding this comment.
Done, thanks for the review!
| [testenv:pytest-min] | ||
| extras = testing | ||
| deps = | ||
| pytest == 6.1.0 |
There was a problem hiding this comment.
Make sure that the plugin works with minimal requirements.
| def test_async_auto_marked(pytester): | ||
| pytester.makepyfile( | ||
| def test_async_auto_marked(testdir): | ||
| testdir.makepyfile( |
There was a problem hiding this comment.
Required for pytest 6.1 as I see. Not a big problem though, the used API is the same.
|
I like that you added a tox env for the minimum pytests version! I think the added type annotations may have broken this PR, though. On commit c0ca686 I get this error: |
|
@seifertm fair point! I've converted the type annotation for FixtureRequest to string, tests on 6.1 are passed now: https://github.com/pytest-dev/pytest-asyncio/runs/4832158093?check_suite_focus=true#step:5:63 |
|
I have no idea why GitHub didn't run checks for yesterday's commits. |
|
I'd like to merge it |
Fixes #262