Skip to content

request: add commandline option not to import from current directory #2605

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

Closed
ghost opened this issue Jul 21, 2017 · 6 comments
Closed

request: add commandline option not to import from current directory #2605

ghost opened this issue Jul 21, 2017 · 6 comments
Labels
status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity type: question general question, might be closed after 2 weeks of inactivity

Comments

@ghost
Copy link

ghost commented Jul 21, 2017

Adding a commandline option not to import from the current directory would allow cleaner workflow for scipy. All that needs to be done is this if the commandline is passed.

import sys
sys.path.remove('')
@nicoddemus
Copy link
Member

Pytest by default doesn't add the current directory... are you running python -m pytest? If so take a look at this docs:

except that python will also add the current directory to sys.path.

@nicoddemus nicoddemus added type: question general question, might be closed after 2 weeks of inactivity status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity labels Jul 21, 2017
@ghost
Copy link
Author

ghost commented Jul 21, 2017

Hrm... something else may be going on here. I will look into this further later today.

@nicoddemus
Copy link
Member

OK, sounds good

@ghost
Copy link
Author

ghost commented Jul 22, 2017

This is not caused by pytest.

@ghost ghost closed this as completed Jul 22, 2017
@ghost ghost reopened this Jul 22, 2017
@ghost
Copy link
Author

ghost commented Jul 22, 2017

Update: this issue occurs with pytest-xdist. Should I file there?

@RonnyPfannschmidt
Copy link
Member

yes please

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

2 participants