-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
basedir not being added to sys.path for doctests #54
Comments
Original comment by Leonardo Santagada (BitBucket: santagada, GitHub: santagada): This works fine in nose why not make it work in py.test? I know it depends on the cwd, but anything that help taking out the pain to run doctests seems like a good thing to me. And adding a init.py should make it add the parent dir to sys.path anyway and then it should work indepently from the cwd. |
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): The general strategy is to require "python setup.py develop" or "pip install -e ." when running tests, for the tests to find the code they are supposed to test. Otherwise it becomes hard to run the tests against an installed package which is something where py.test shouldn't get in the way. |
Originally reported by: Leonardo Santagada (BitBucket: santagada, GitHub: santagada)
when I run py.test 2.0.3 in a project with this dir tree:
if I run "py.test --doctest-glob='*.txt'" pytest doesn't add projname to sys.path, the error is that the tests can't import module. Even if I put a init.py in tests it still doesn't add the basedir in sys.path.
The text was updated successfully, but these errors were encountered: