10000 Qt4 keys by tacaswell · Pull Request #2749 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Qt4 keys #2749

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 21 commits into from
Jan 22, 2014
Merged
Show file tree
Hide file tree
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
require mock
  • Loading branch information
mrterry committed Sep 19, 2013
commit 32ddf1e978afecdf6bc2c067d757ee399b824fd5
16 changes: 11 additions & 5 deletions lib/matplotlib/tests/test_backend_qt4.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@
from matplotlib._pylab_helpers import Gcf
import copy

import mock
try:
# mock in python 3.3+
from unittest import mock
except ImportError:
import mock

try:
from matplotlib.backends.qt4_compat import QtCore
from matplotlib.backends.backend_qt4 import MODIFIER_KEYS, SUPER, ALT, CTRL, SHIFT
from matplotlib.backends.backend_qt4 import (MODIFIER_KEYS,
SUPER, ALT, CTRL, SHIFT)

_, ControlModifier, ControlKey = MODIFIER_KEYS[CTRL]
_, AltModifier, AltKey = MODIFIER_KEYS[ALT]
_, SuperModifier, SuperKey = MODIFIER_KEYS[SUPER]
_, ShiftModifier, ShiftKey = MODIFIER_KEYS[SHIFT]

HAS_QT = True
except ImportError as e:
except ImportError:
HAS_QT = False


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


@cleanup
@knownfailureif(not HAS_QT)
def test_backspace():
assert_correct_key(QtCore.Qt.Key_Backspace,
QtCore.Qt.NoModifier,
u'backspace')


@cleanup
@knownfailureif(not HAS_QT)
def test_backspace():
def test_backspace_mod():
assert_correct_key(QtCore.Qt.Key_Backspace,
ControlModifier,
u'ctrl+backspace')
22 changes: 4 additions & 18 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,23 +612,6 @@ def get_namespace_packages(self):
class Tests(OptionalPackage):
name = "tests"

def check(self):
super(Tests, self).check()

try:
import nose
except ImportError:
return (
"nose 0.11.1 or later is required to run the "
"matplotlib test suite")

if nose.__versioninfo__ < (0, 11, 1):
return (
"nose 0.11.1 or later is required to run the "
"matplotlib test suite")

return 'using nose version %s' % nose.__version__

def get_packages(self):
return [
'matplotlib.tests',
Expand All @@ -648,7 +631,10 @@ def get_package_data(self):
]}

def get_install_requires(self):
return ['nose']
requires = ['nose>=0.11.1']
if not is_min_version(sys.version_info, '3.3'):
requires += ['mock']
return requires


class Numpy(SetupPackage):
Expand Down
0