summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py12
1 files changed, 7 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