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' |
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!
@chrisamow I know, it's been a long long time. But did you solve that problem?