-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 importlib doesn't work with pickle #7859
Labels
type: bug
problem that needs to be addressed
Comments
I'd say that it is closely related to #7856. I didn't dig into that yet, but it seems like the problem is with importing, not pickling. |
tadeu
added a commit
to tadeu/pytest
that referenced
this issue
Oct 7, 2020
tadeu
added a commit
to tadeu/pytest
that referenced
this issue
Oct 7, 2020
tadeu
added a commit
to tadeu/pytest
that referenced
this issue
Oct 7, 2020
nicoddemus
pushed a commit
to tadeu/pytest
that referenced
this issue
Dec 19, 2020
nicoddemus
pushed a commit
to tadeu/pytest
that referenced
this issue
Apr 2, 2021
nicoddemus
pushed a commit
that referenced
this issue
Apr 5, 2021
…sses or pickle (#7870) Co-authored-by: Bruno Oliveira <[email protected]> Fixes #7856, fixes #7859
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
Feb 14, 2022
…mportlib' The dummy modules we introduce in `insert_missing_modules` (due to pytest-dev#7856 and pytest-dev#7859) would cause problems if the dummy modules actually end up replacing modules which could be imported normally because they are available in `PYTHONPATH`. Now we attempt to first import the module via normal mechanisms, and only introduce the dummy modules if the intermediary modules don't actually exist. Close pytest-dev#9645
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
Feb 14, 2022
…mportlib' The dummy modules we introduce in `insert_missing_modules` (due to pytest-dev#7856 and pytest-dev#7859) would cause problems if the dummy modules actually end up replacing modules which could be imported normally because they are available in `PYTHONPATH`. Now we attempt to first import the module via normal mechanisms, and only introduce the dummy modules if the intermediary modules don't actually exist. Close pytest-dev#9645
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm transitioning from pytest regular imports to --import-mode=importlib imports due to namespace collisions in tests. And I'm getting the following crash, no plugins installed,
pytest 6.1.1
CPython 3.8.6
, the issue reproduces on Mac & Linux.Create a file named test_xx.py:
Running the same code without pytest or with pytest without importlib work as expected.
pip list:
I encountered this issue because we have tests using
multiprocessing.Pool
, and they fail on pickling the target function.The text was updated successfully, but these errors were encountered: