New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests/test_pytest_plugin.py::test_aiohttp_plugin fails on Alpine Linux (python 3.11 and python 3.12) #8234
Comments
Trivially fixable if you'd like to make a contribution. Though I'd also like to know why this isn't reproducing in our CI. The test appears to be passing: https://github.com/aio-libs/aiohttp/actions/runs/8210202661/job/22457206363#step:11:1653 |
I actually tried. Spent half an hour on it or so, without great success. It was somewhat complicated due to it is a nested test, a pytest that tests another pytest. Its not that I don't want to contribute, but I figured someone who are more familiar with the code would do it in significantly less time than me.
Exactly! I noticed that too and found it weird. What version of pytest are you using? I have bumped in several cases where pytest-8 breaks things. (I am in the process of updating python to 3.12 for Alpine Linux. 1375 python packages left to build. Today I was able to rebuild ~58. I calculated that it will take me 24 days with current speed if I am able to spend 100% of my time on this.) |
The linked CI log says it's 8.0.2: We don't touch that code often so it's unlike it'll be faster for us to fix. Anyway, are you able to provide a minimum reproducer with an Alpine container or something like that? It may have clues to what's different. Like maybe you have a Pure-python build w/o C-extensions or something.. |
FWIW it's probably the filterwarnings setting or equivalent that is turning warnings to errors. Not sure why, though. Also, don't we have 3.9.4 already? |
Huh, it should just be replacing the strings as per the documentation linked in the warning. At a glance, it's just aiohttp/tests/test_pytest_plugin.py Lines 70 to 73 in 0588e34
Only problem with me making the change is that I can't see the error in the first place to confirm it's fixed.
Uh, no, I was partly waiting on another fix to merge and partly got caught up with other things. Will make the release next week. |
I think problem is related pytest 8, which changes how warnings are handled. As I read the test, it is checking that warnings are raised? aiohttp/tests/test_pytest_plugin.py Line 107 in 77f5633
|
diff --git a/tests/test_pytest_plugin.py b/tests/test_pytest_plugin.py
index b25a553..5faa254 100644
--- a/tests/test_pytest_plugin.py
+++ b/tests/test_pytest_plugin.py
@@ -73,9 +73,10 @@ async def test_noop() -> None:
async def previous(request):
+ value_key = web.AppKey("value", str)
if request.method == 'POST':
with pytest.deprecated_call(): # FIXME: this isn't actually called
- request.app['value'] = (await request.post())['value']
+ request.app[value_key] = (await request.post())[value_key]
return web.Response(body=b'thanks for the data')
else:
v = request.app.get('value', 'unknown') The result is:
|
Right, not clear what's changed, but this is reproducing in the Dependabot PR: #8223
No, that line long predates AppKey: https://github.com/aio-libs/aiohttp/blame/77f5633ce02da71c6879d3b25b5fbe8b240647c6/tests/test_pytest_plugin.py#L107 |
Oh, also, the tests are passing in current pytest on master. So, there must be some difference with 3.x. |
I don't see any |
OK, will take a look next week, I'm away for the next few days. |
Thank you! Enjoy! |
Describe the bug
The
test_pytest_plugin.py
expects that all the 12 embedded testcases passes, but 2 fails.To Reproduce
build aiohttp on alpine linux edge and run:
Expected behavior
It is expected that the test(s) passes.
Logs/tracebacks
aiohttp Version
aiohttp-3.9.3
multidict Version
yarl Version
OS
Related component
Server, Client
Additional context
This blocks the 3.9.3 security upgrade for alpine.
Code of Conduct
The text was updated successfully, but these errors were encountered: