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

Introduce a backdoor around PYTHONPATH scrubbing in pytest runs. #5767

Merged
merged 5 commits into from May 1, 2018

Conversation

Projects
None yet
3 participants
@benjyw
Copy link
Contributor

benjyw commented Apr 28, 2018

This allows a user who knows what they're doing to, e.g., use external debuggers to step into test code. E.g., PyCharm's graphical debugger requires pycharm-debug.egg to be on the PYTHONPATH.

Introduce a backdoor around PYTHONPATH scrubbing in pytest runs.
This allows a user who knows what they're doing to, e.g., use
debuggers that require extra code on the PYTHONPATH during
a debug session.

@benjyw benjyw requested a review from jsirois Apr 28, 2018

@wisechengyi

This comment has been minimized.

Copy link
Contributor

wisechengyi commented Apr 28, 2018

Interesting. Can you document the debugging practice as well?

@benjyw

This comment has been minimized.

Copy link
Contributor

benjyw commented Apr 29, 2018

I will add something to the docsite, good idea.

@wisechengyi
Copy link
Contributor

wisechengyi left a comment

Thanks!

@jsirois
Copy link
Member

jsirois left a comment

LGTM in terms of feature, but is there any reason not to just register an advanced option and get the ENV var for free + more standard docs in addition to your README addition?

@benjyw

This comment has been minimized.

Copy link
Contributor

benjyw commented Apr 30, 2018

That is an excellent question. I think I did it this way because my .bashrc previously set PYTHONPATH, and I suddenly noticed it was being scrubbed, so I was thinking in terms of setting some other env var, and making it an option never occurred to me.

But of course that env var can set an option... Will change.

@benjyw

This comment has been minimized.

Copy link
Contributor

benjyw commented Apr 30, 2018

OK, fixed, thanks for the clearly superior suggestion.

register('--extra-pythonpath', type=list, fingerprint=True, advanced=True,
help='Add these entries to the PYTHONPATH when running the tests. '
'Useful for attaching to debuggers in test code.'
'')

This comment has been minimized.

@jsirois

jsirois Apr 30, 2018

Member

The trailing '' is strange but fine.

This comment has been minimized.

@benjyw

benjyw Apr 30, 2018

Contributor

That was in error. Removed.

@benjyw benjyw merged commit 03dd631 into pantsbuild:master May 1, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@benjyw benjyw deleted the benjyw:pythonpath_backdoor branch May 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment