Arrange files like this:
apple/
__init__.py
apple.py
tests/
test_everything.py
And execute with:
export PYTHONPATH=.
py.test
(This Gist was used to answer a question at stackoverflow)
Arrange files like this:
apple/
__init__.py
apple.py
tests/
test_everything.py
And execute with:
export PYTHONPATH=.
py.test
(This Gist was used to answer a question at stackoverflow)
def eat(): | |
return 'eaten' |
from apple import apple | |
def test_apple(): | |
assert apple.eat() == 'eaten' |
@chrisamow I know, it's been a long long time. But did you solve that problem?
Wanted to notice that you can run set an environment variable just for one command:
PYTHONPATH=. pytest
# or in fish shell
env PYTHONPATH=. pytest
It worked for me. Thanks for your example on SO!
I thought I was going crazy with py.test problems, so I tried your example... (something going on with python3.6 ?!)