-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
pytest 6.0.0 raises a lot of errors related to importing #7560
Comments
For Ansible, it was ab6dacf that broke us (thanks @relrod for tracking that down!). The hack we use for locating test modules under PEP420 packages was broken by the impl change away from BTW- thanks @nicoddemus for adding |
Thanks for commenting @nitzmahone, this made me look if we have any usage of I'm leaving this open for now, but it's probably entirely on us for doing what we were doing. |
Ditto, we know we're doing a Bad Thing, but I haven't looked to see if we could get the same result with something like a custom collector. Doubtful we could do it "properly" with so little code, just at the cost of it being really brittle... 😑 |
From a quick look at the logs @jack1142 posted, it seems like pytest is trying to import a module called
The code tested by I bisected pytest against the Red-DiscordBot testsuite and ab6dacf / #7246 ("Introduce --import-mode=importlib") broke this. cc @nicoddemus |
Thanks @The-Compiler! Seems however that #7560 (comment) found the solution due to a monkeypatch of |
IMO it can be closed, but I didn't want to make that decision for the maintainers of pytest in case I missed some other issue here. |
Ah, sorry, I missed that comment. It's too hot to think today 😅 Agreed that this can be closed then, I don't think we can protect much against builtins/stdlib being patched. Also see the note at the bottom of https://docs.pytest.org/en/stable/monkeypatch.html#global-patch-example-preventing-requests-from-remote-operations. |
Hi,
I don't really know what happened here, but I tried to update to pytest 6.0.0 (from pytest 5.4.3) and running tests now ends up in 13MB log of errors. Only other info I can give is that using
--import-mode=importlib
flag fixes it.I know this isn't incredibly helpful description, but I honestly have no idea what happened there, I can answer any follow up questions if needed.
Logs of failing run without any flags: https://github.com/jack1142/Red-DiscordBot/commit/9b2437278a64a303193717e8ce1ec197e3de1f25/checks/921018915/logs
Logs of successful run with
--import-mode=importlib
flag: https://github.com/jack1142/Red-DiscordBot/commit/e6f033855c69854e3be8401df9c62729d60054a5/checks/921089665/logsThe text was updated successfully, but these errors were encountered: