diff options
-rw-r--r-- | tests/test_cmd2.py | 12 | ||||
-rw-r--r-- | tox.ini | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 2da75f93..04498c49 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -6,20 +6,22 @@ Copyright 2016 Federico Ceratto <federico.ceratto@gmail.com> Released under MIT license, see LICENSE file """ import argparse +from code import InteractiveConsole import os import sys import io import tempfile -from unittest import mock import pytest import six - -from code import InteractiveConsole - -# Used for sm.input: raw_input() for Python 2 or input() for Python 3 import six.moves as sm +# Python 3.5 had some regressions in the unitest.mock module, so use 3rd party mock if available +try: + import mock +except ImportError: + from unittest import mock + import cmd2 from conftest import run_cmd, normalize, BASE_HELP, BASE_HELP_VERBOSE, \ HELP_HISTORY, SHORTCUTS_TXT, SHOW_TXT, SHOW_LONG, StdOut @@ -22,6 +22,7 @@ commands = py.test -v -n2 --forked [testenv:py35] deps = + mock pyparsing pyperclip pytest @@ -33,6 +34,7 @@ commands = py.test -v -n2 --forked [testenv:py35-win] deps = + mock pyparsing pyperclip pyreadline |