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

allow python3 tests without python installed #3301

Merged
merged 2 commits into from May 10, 2013

Conversation

juliantaylor
Copy link
Contributor

also closes gh-3280 via a documentation and test update

@@ -24,13 +25,15 @@
from IPython.testing import decorators as dec
from IPython.testing import tools as tt

python = os.path.basename(sys.executable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use sys.executable in the even more remote chance that python3 isn't in the PATH either?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the find_cmd tes needs the basename and exe on path, so it doesn't really matter.

@bfroehle
Copy link
Contributor

Everything else looks good to me, so merging.

bfroehle added a commit that referenced this pull request May 10, 2013
allow python3 tests without python installed
@bfroehle bfroehle merged commit 262abcd into ipython:master May 10, 2013
#-----------------------------------------------------------------------------
# Tests
#-----------------------------------------------------------------------------

def test_find_cmd_python():
"""Make sure we find sys.exectable for python."""
nt.assert_equal(find_cmd('python'), sys.executable)
nt.assert_equal(find_cmd(python), sys.executable)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test fails on OS X - 'python' is a special key handled by find_cmd short-circuited to sys.executable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but its still the string 'python'?
mac does not add extensions like windows so far I know

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Python executable is not on the path, in a framework build (e.g. from Python.org), it's in the framework - something like /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python. You have really changed what this test means - it was a test for the short-circuit code:

does the string 'python' give back sys.executable?

But you changed it to something else:

does the string basename(sys.executable) give back sys.executable?

Which does not describe the behavior of the code this tests, so it fails in some cases. PR #3342 reconciles the code with the test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but its still the string 'python'?

To answer your question directly: no, it is Python.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
allow python3 tests without python installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPython.utils.process.getoutput returns stderr
3 participants