8000 FIX assert_raises cannot be called with ``with\\ by NelleV · Pull Request #1159 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

FIX assert_raises cannot be called with ``with\\ #1159

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

Merged
merged 1 commit into from
Aug 28, 2012
Merged

FIX assert_raises cannot be called with ``with\\ #1159

merged 1 commit into from
Aug 28, 2012

Conversation

NelleV
Copy link
Member
@NelleV NelleV commented Aug 28, 2012

with assert_raises(ValueError):
something

does not work with nose 1.1.2 (raises a TypeError: TypeError: failUnlessRaises() takes at least 3 arguments (2 given))

This PR fixes some of the remaining failing tests on my machine (I still have some, but they seem more tricky to fix)

  - Fixed 5 tests failing
  - PEP8 compliance
@mdboom
Copy link
Member
mdboom commented Aug 28, 2012

Hmm... I'm running nose 1.1.2 as well, and I don't have a problem with this usage of assert_raises. Can you post the entire traceback?

@NelleV
Copy link
Member Author
NelleV commented Aug 28, 2012

The difference is that I'm working with python2.6, and not python2.7. There are a couple of things that were introduced in python2.7 and not backported by nosetests to python2.6. assertIs is one of those. The usage of assert_raises with with is another. Here is the traceback:

ERROR: main.test_LogLocator

Traceback (most recent call last):
File "/home/nelle/Projets/matplotlib/matplotlib/py2.6/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "lib/matplotlib/tests/test_ticker.py", line 37, in test_LogLocator
with assert_raises(ValueError):
TypeError: failUnlessRaises() takes at least 3 arguments (2 given)

This test works fine with python2.7

@mdboom
Copy link
Member
mdboom commented Aug 28, 2012

I see. This seems like a very worthwhile fix, then.

mdboom added a commit that referenced this pull request Aug 28, 2012
FIX assert_raises cannot be called with ``with\\
@mdboom mdboom merged commit 85e3d4b into matplotlib:master Aug 28, 2012
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.

2 participants
0