Skip to content

Pytest suddenly cannot find module #3789

@adamhrosenberg

Description

@adamhrosenberg

Hello. I use pytest on a CI server to test our software. We have been using pytest for years but with the latest update we have an error importing a module during pytest. My logic behind isolating this issue to pytest is: on the CI server, nothing has changed (same python, same code, same OS image) the updated version of pytest is the only thing that has changed.

original versions of what pytest passed with
platform linux2 -- Python 2.7.12, pytest-3.6.3, py-1.5.4, pluggy-0.6.0

current versions where I get failures:
platform linux2 -- Python 2.7.12, pytest-3.7.1, py-1.5.4, pluggy-0.7.1

Let's say the module that cannot import is called X. When within the directory of X, (where the _UnitTest directory is) running pytest allows all of the tests to pass. Changing directory back one layer (or anywhere outside of the X directory), now those tests from module X fail because the import statement failed.

Also on macOS I had all of the tests passing with pytest 3.6.3. Upgraded pytest, and now the tests related to module X fail. Many other modules import and work however module X does not. I have debugged a lot of it, and all of the paths look good, but it still fails to import. I'm not exactly sure what sets module X apart from the other dozens of module we use successfully.

I hope this makes sense and I can elaborate more if needed. I am not working in a virtualenv but I can put full pip lists in the comments if more is needed other then the versions I gave above.

Thank you

Adam

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs informationreporter needs to provide more information; can be closed after 2 or more weeks of inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions