-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
ImportError while loading conftest - Python3 #7408
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
Comments
Can you try this with pytest master and say if the behavior is the same?
Also with this version, can you try with different values of the |
@bluetech I have the latest version of pytest on my machine:
|
Also,
And:
|
Right, the |
|
Can you try |
It did not run my tests and ran some tests in my |
|
@bluetech I have updated the tree above. And my |
Can you post the |
|
Hmm that's weird. Is it maybe a symlink to a vendored version |
|
It's possible the second As for the original issue, the |
@bluetech I deleted the |
Hey guys, Could I please get some help here? I am really stuck at this one here. |
There's just not much that we can do (beyond speculation!) without a reproducing example. Can you point us to a repo which demonstrates this behaviour? |
I just ran into a very similar problem:
I could fix it by adding |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is not working for me. I hav tried both the options. I am using Python 3.8.9 version with Pytest 7.0.2 |
Sorry, but you're likely going to need to provide a lot more key details in order for others to provide a useful response, including the full input/ouput/error of the command you ran and a reproducible example (either as a repository or a minimal toy example). |
well, for me, i had to delete all the |
This is an incredibly common, and highly annoying issue. What could be stopping pytest from seeing the environment it's literally running in? Every single time I write a test after adding a library to my project, I go through this, and I end up just messing with it until it eventually decides to do what it's supposed to after a couple of hours |
@ronaldroe what problem do you mean exactly? "import error" is indeed a common problem, but might have a number of causes. Feel free to open a new issue if this is something you struggle constantly in recent pytest versions. Also mind we have a set of good practices in the docs (use a virtual environment, install your package with |
I have encountered the same problem. Is there any solution? Thanks in advance |
@oscarli see #7408 (comment). |
I am trying to use
pytest-django
for writing my unit tests.I have a project structure like:
Now my
pytest.ini
looks like:Also, my
conftest.py
looks like:Also, my
test_views.py
looks like:When I issue a
pytest
command on my terminal from the directory where myconftest.py
is situated I get:I have been banging my head against the wall since yesterday to get a solution to this problem.
I have googled my way into everything and did not find a solution which is when I decided to reach out to the community here.
What am I doing wrong guys? What am I missing here?
The text was updated successfully, but these errors were encountered: