Skip to content

Switch testing to pytest completely #7974

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 14 commits into from
Feb 3, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIX: implement __ne__ for SubplotSpec
In python3 `__ne__` automatically delegates to `__eq__`, in python2 it
does not and falls back to the default `__ne__` test.  The NumPy
version of `assert_equal` actually checks `if a != b: raise`, whereas the
version of `assert_equal` from `unittest` (where `nose` ultimately
pulls from) checks `if not a == b: raise`
  • Loading branch information
tacaswell authored and QuLogic committed Feb 2, 2017
commit ed7d353a7e8c3127378727f0eb4fb2d790ef0364
5 changes: 4 additions & 1 deletion lib/matplotlib/gridspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ def get_position(self, fig, return_all=False):
else:
return figbox


def get_topmost_subplotspec(self):
'get the topmost SubplotSpec instance associated with the subplot'
gridspec = self.get_gridspec()
Expand All @@ -473,6 +472,10 @@ def __eq__(self, other):
self.num1 == other.num1,
self.num2 == other.num2))

if six.PY2:
def __ne__(self, other):
return not self == other

def __hash__(self):
return (hash(self._gridspec) ^
hash(self.num1) ^
Expand Down