8000 BUG: use unittest.mock for Python 3.3+ by matthew-brett · Pull Request #3189 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

BUG: use unittest.mock for Python 3.3+ #3189

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
Jul 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
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
BUG: use unittest.mock for Python 3.3+
Some tests had unguarded import of 'mock', but 'mock' package not
installed for Python 3.3+; change to use 'unittest.mock'.
  • Loading branch information
matthew-brett committed Jul 5, 2014
commit 672a88a620e3f2d77200e150cce8e19d3f38fde1
6 changes: 5 additions & 1 deletion lib/matplotlib/tests/test_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
import tempfile

import dateutil
import mock
try:
# mock in python 3.3+
from unittest import mock
except ImportError:
import mock
from nose.tools import assert_raises, assert_equal

from matplotlib.testing.decorators import image_comparison, cleanup
Expand Down
7 changes: 5 additions & 2 deletions lib/matplotlib/tests/test_legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

import six
from six.moves import xrange

import mock
try:
# mock in python 3.3+
from unittest import mock
except ImportError:
import mock
from nose.tools import assert_equal
import numpy as np

Expand Down
9 changes: 7 additions & 2 deletions lib/matplotlib/tests/test_patheffects.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@

import six

import mock
from nose.tools import assert_equal
import numpy as np

from matplotlib.testing.decorators import image_comparison, cleanup
import matplotlib.pyplot as plt
import matplotlib.patheffects as path_effects

try:
# mock in python 3.3+
from unittest import mock
except ImportError:
import mock
from nose.tools import assert_equal


@image_comparison(baseline_images=['patheffect1'], remove_text=True)
def test_patheffect1():
Expand Down
0