I haven't touched python in a long time and I forgot how much of a pain importing can be.
So I'm using pylance and pipenv as my shell. I have pytest installed in my local env, I can run pytest from the command line and test my code. However, I can't import it in the same file I'm running my tests from. Any idea what might be causing that problem?
Python version 3.9
I have my tests in a separate file right below root. I don't have a init.py file in tests. I've read that that can cause problems.
I tried h. deville fletcher's answer and it didn't seem to work for me, but I could have messed up in there too. However, in the process, I remembered that I hadn't changed my interpreter. Once I changed the interpreter to my pipenv shell that fixed my problem.
"pytest" is not accessed / Import "pytest" could not be resolved - Pylance