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

Fix some tests for Python 3.3 #1748

Merged
merged 10 commits into from
May 29, 2012
Merged

Fix some tests for Python 3.3 #1748

merged 10 commits into from
May 29, 2012

Conversation

takluyver
Copy link
Member

Update: All tests are now passing on Python 3.3.

The main change is that, for security reasons, the ordering of dicts is unpredictable. It's never something we should have been relying on, but various doctests did depend on the order.

Most of the remaining test failures seem to be problems with importing things - I'll look more carefully at the documentation, but I think there might be bugs in the new implementation of import.

@takluyver
Copy link
Member Author

Isolated one (potential) issue in importlib. Commit a894e07 fixes what was causing the error from our side, and I've sent an issue to the Python bug tracker too: http://bugs.python.org/issue14846

@takluyver
Copy link
Member Author

Test results for commit a894e07 merged into master
Platform: linux2

  • python2.7: OK
  • python3.1: OK (libraries not available: matplotlib pymongo qt wx wx.aui zmq)
  • python3.2: Failed, log at https://gist.github.com/2731350 (libraries not available: pymongo wx wx.aui)

Not available for testing:

@takluyver
Copy link
Member Author

Test results for commit a894e07 merged into master
Platform: linux2

  • python2.7: OK
  • python3.1: OK (libraries not available: matplotlib pymongo qt wx wx.aui zmq)
  • python3.2: OK (libraries not available: pymongo wx wx.aui)

Not available for testing:

@takluyver
Copy link
Member Author

The failure the first time seems to be one of those intermittent failures in parallel we see from time to time, not related to this issue.

@takluyver
Copy link
Member Author

Test results for commit 2873d08 merged into master
Platform: linux2

  • python2.7: OK
  • python3.1: OK (libraries not available: matplotlib pymongo qt wx wx.aui zmq)
  • python3.2: OK (libraries not available: pymongo wx wx.aui)

Not available for testing: python2.6

@takluyver
Copy link
Member Author

All tests are passing on Python 3.3 now, but setting up a virtualenv still doesn't work straight off, so I haven't added it to the PR test script yet.

@minrk
Copy link
Member

minrk commented May 23, 2012

Thanks! Seems to me like doctests are more trouble than they are worth.

@takluyver
Copy link
Member Author

Tell me about it ;-)

@takluyver
Copy link
Member Author

Rebased because of conflicts after #1732 was merged.

@takluyver
Copy link
Member Author

And all tests are passing again on Python 3.3.

@@ -160,7 +160,7 @@ class defaults.
final_help = []
final_help.append(u'%s options' % cls.__name__)
final_help.append(len(final_help[0])*u'-')
for k,v in cls.class_traits(config=True).iteritems():
for k,v in sorted(cls.class_traits(config=True).iteritems()):
Copy link
Member

Choose a reason for hiding this comment

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

No, this adds cost to all instances only for the benefit of a doctest. Instead, the test should be changed, to not depend on the order (it can do a set check on both keys and values, for example.

Copy link
Member Author

Choose a reason for hiding this comment

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

Note that this affects how the options for help are printed - I think it's awkward to have the options displayed in a random order each time you do something like ipython --help-all.

Given that this method is only called to display help information (class_get_help()), I think the cost of Python's built in sort is going to be negligible compared to the speed with which output can be written. This was probably the place I was most confident that sorting was the right way to go.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I didn't realize this was inside of a method called for interactive help, sorry. For some reason I thought it was in the constructor itself and that it would thus affect everything all the time.

Yes, I agree that if it's only invoked interactively at help time, it's OK. Sorry for the misfire.

@fperez
Copy link
Member

fperez commented May 29, 2012

OK, it turns out my review was 100% pure noise, zero signal! A new record :)

This is otherwise great, merging. Thanks for the good work!

fperez added a commit that referenced this pull request May 29, 2012
Fix some tests for Python 3.3.
@fperez fperez merged commit 8304318 into ipython:master May 29, 2012
@takluyver
Copy link
Member Author

Thanks, Fernando. I'd rather explain some of the changes than have them go unreviewed, so I'm not complaining.

Hopefully that will improve the numbers on ShiningPanda, but there are also some test failures I don't see on my local installation. If they continue, I'll see if they go when ShiningPanda gets the next 3.3 alpha before I investigate them.

@fperez
Copy link
Member

fperez commented May 29, 2012

On Tue, May 29, 2012 at 4:37 PM, Thomas Kluyver
reply@reply.github.com
wrote:

Thanks, Fernando. I'd rather explain some of the changes than have them go unreviewed, so I'm not complaining.

Yup, that's the purpose of code review :)

Hopefully that will improve the numbers on ShiningPanda, but there are also some test failures I don't see on my local installation. If they continue, I'll see if they go when ShiningPanda gets the next 3.3 alpha before I investigate them.

Excellent, thanks! I'm thrilled to know that we'll be ready for 3.3
as it lands.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Fix some tests for Python 3.3.
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.

3 participants