Skip to content
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 when the tests dir doesn't have an __init__.py file #55

Closed
pytestbot opened this issue Jun 22, 2011 · 6 comments
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Leonardo Santagada (BitBucket: santagada, GitHub: santagada)


if the tests is a subdirectory of my module and it doesn't have an init.py py.test doesn't add the correct basedir to sys.path.

I think the correct logic would be to check and if the directory to be used as basedir has as its parent a directory with an init.py it should go deeper... okay I wasn't very clear here, but what I want is to be able to have tests dir that is not importable and doesn't need to have a init.py


@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


can you provide an example? I would think that it should already work like you describe.

@pytestbot
Copy link
Contributor Author

Original comment by Anonymous:


In this:
http://dl.dropbox.com/u/3117862/pytestcase.zip

if you run py.test inside the pytestcase directory it doesnt insert pytestcase to the path, but if you put a init.py in the test dir it does. In nose both work as expected (the basedir is found and added to sys.path).

@pytestbot
Copy link
Contributor Author

Original comment by Leonardo Santagada (BitBucket: santagada, GitHub: santagada):


the last comment was me... I forgot to log on.

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


don't think we should copy nose behabviour here. Can't you or don't you want to add a setup.py which provides "setup.py develop" for this to work? If not, why not?

@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


can we close this one?

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


Duplicate of #54.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant