8000 require mock · matplotlib/matplotlib@32ddf1e · GitHub
[go: up one dir, main page]

Skip to content

Commit 32ddf1e

Browse files
committed
require mock
1 parent bf4e43d commit 32ddf1e

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

lib/matplotlib/tests/test_backend_qt4.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,23 @@
88
from matplotlib._pylab_helpers import Gcf
99
import copy
1010

11-
import mock
11+
try:
12+
# mock in python 3.3+
13+
from unittest import mock
14+
except ImportError:
15+
import mock
1216

1317
try:
1418
from matplotlib.backends.qt4_compat import QtCore
15-
from matplotlib.backends.backend_qt4 import MODIFIER_KEYS, SUPER, ALT, CTRL, SHIFT
19+
from matplotlib.backends.backend_qt4 import (MODIFIER_KEYS,
20+
SUPER, ALT, CTRL, SHIFT)
1621

1722
_, ControlModifier, ControlKey = MODIFIER_KEYS[CTRL]
1823
_, AltModifier, AltKey = MODIFIER_KEYS[ALT]
1924
_, SuperModifier, SuperKey = MODIFIER_KEYS[SUPER]
2025
_, ShiftModifier, ShiftKey = MODIFIER_KEYS[SHIFT]
21-
2226
HAS_QT = True
23-
except ImportError as e:
27+
except ImportError:
2428
HAS_QT = False
2529

2630

@@ -124,16 +128,18 @@ def test_modifier_order():
124128
(ControlModifier | AltModifier | SuperModifier),
125129
u'ctrl+alt+super+' + unichr(225))
126130

131+
127132
@cleanup
128133
@knownfailureif(not HAS_QT)
129134
def test_backspace():
130135
assert_correct_key(QtCore.Qt.Key_Backspace,
131136
QtCore.Qt.NoModifier,
132137
u'backspace')
133138

139+
134140
@cleanup
135141
@knownfailureif(not HAS_QT)
136-
def test_backspace():
142+
def test_backspace_mod():
137143
assert_correct_key(QtCore.Qt.Key_Backspace,
138144
ControlModifier,
139145
u'ctrl+backspace')

setupext.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -612,23 +612,6 @@ def get_namespace_packages(self):
612612
class Tests(OptionalPackage):
613613
name = "tests"
614614

615-
def check(self):
616-
super(Tests, self).check()
617-
618-
try:
619-
import nose
620-
except ImportError:
621-
return (
622-
"nose 0.11.1 or later is required to run the "
623-
"matplotlib test suite")
624-
625-
if nose.__versioninfo__ < (0, 11, 1):
626-
return (
627-
"nose 0.11.1 or later is required to run the "
628-
"matplotlib test suite")
629-
630-
return 'using nose version %s' % nose.__version__
631-
632615
def get_packages(self):
633616
return [
634617
'matplotlib.tests',
@@ -648,7 +631,10 @@ def get_package_data(self):
648631
]}
649632

650633
def get_install_requires(self):
651-
return ['nose']
634+
requires = ['nose>=0.11.1']
635+
if not is_min_version(sys.version_info, '3.3'):
636+
requires += ['mock']
637+
return requires
652638

653639

654640
class Numpy(SetupPackage):

0 commit comments

Comments
 (0)
0