diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-04-15 13:14:54 -0700 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-04-15 13:14:54 -0700 |
commit | a6b5733a94eaaf42c5b113de64fced3ea807c91e (patch) | |
tree | bc11927cb07e5ac910450c56d64c42a0a9c14687 | |
parent | e60836418647935572a9a35c7292ea73ff0fba07 (diff) | |
download | cmd2-git-a6b5733a94eaaf42c5b113de64fced3ea807c91e.tar.gz |
Removed unit test dependency on mock
mock was a backport of Python's built in unittest.mock and was required for Python 3.2 or earlier
- Since we now support Python 3.4+ moving forward we no longer need to make use of the 3rd party mock module
-rw-r--r-- | CONTRIBUTING.md | 14 | ||||
-rw-r--r-- | docs/requirements.txt | 1 | ||||
-rwxr-xr-x | setup.py | 3 | ||||
-rw-r--r-- | tests/test_argparse.py | 2 | ||||
-rw-r--r-- | tests/test_cmd2.py | 2 | ||||
-rw-r--r-- | tests/test_completion.py | 2 | ||||
-rw-r--r-- | tests/test_transcript.py | 2 | ||||
-rw-r--r-- | tox.ini | 6 |
8 files changed, 16 insertions, 16 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7398389d..c280b37c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,9 +44,9 @@ The tables below list all prerequisites along with the minimum required version | Prerequisite | Minimum Version | | --------------------------------------------------- | --------------- | -| [Python](https://www.python.org/downloads/) | `3.4 or 2.7` | +| [Python](https://www.python.org/downloads/) | `3.4` | | [six](https://pypi.python.org/pypi/six) | `1.8` | -| [pyparsing](http://pyparsing.wikispaces.com) | `2.0.3` | +| [pyparsing](http://pyparsing.wikispaces.com) | `2.1` | | [pyperclip](https://github.com/asweigart/pyperclip) | `1.6` | #### Additional prerequisites to run cmd2 unit tests @@ -54,7 +54,6 @@ The tables below list all prerequisites along with the minimum required version | Prerequisite | Minimum Version | | ------------------------------------------- | --------------- | | [pytest](http://doc.pytest.org/en/latest/) | `2.6.3` | -| [mock](https://pypi.python.org/pypi/six) | `1.0.1` | ### Additional prerequisites to build cmd2 documentation | Prerequisite | Minimum Version | @@ -196,7 +195,7 @@ Once you have cmd2 cloned, before you start any cmd2 application, you first need pip install -U six pyparsing pyperclip # Install prerequisites for running cmd2 unit tests -pip install -U pytest mock +pip install -U pytest # Install prerequisites for building cmd2 documentation pip install -U sphinx sphinx-rtd-theme @@ -480,6 +479,13 @@ Here is some advice regarding what makes a good pull request (PR) from the persp - Code coverage of the unit tests matters, try not to decrease it - Think twice before adding dependencies to 3rd party libraries (outside of the Python standard library) because it could affect a lot of users +### Developing and Debugging in an IDE + +We recommend using [Visual Studio Code](https://code.visualstudio.com) with the [Python extension](https://code.visualstudio.com/docs/languages/python) and it's [Integrated Terminal](https://code.visualstudio.com/docs/python/debugging) debugger for debugging since it has +excellent support for debugging console applications. + +[PyCharm](https://www.jetbrains.com/pycharm/) is also quite good and has very nice [Code Inspection](https://www.jetbrains.com/help/pycharm/code-inspection.html) capabilities. + ### Acknowledgement Thanks to the good folks at [freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) for creating an excellent `CONTRIBUTING` file which we have borrowed heavily from. diff --git a/docs/requirements.txt b/docs/requirements.txt index b8cf9271..44427665 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,3 +4,4 @@ pyperclip contextlib2 enum34 subprocess32 +wcwidth @@ -82,8 +82,7 @@ if int(setuptools.__version__.split('.')[0]) < 18: if sys.version_info < (3, 5): INSTALL_REQUIRES.append('contextlib2') -# unittest.mock was added in Python 3.3. mock is a backport of unittest.mock to all versions of Python -TESTS_REQUIRE = ['mock', 'pytest', 'pytest-xdist'] +TESTS_REQUIRE = ['pytest', 'pytest-xdist'] DOCS_REQUIRE = ['sphinx', 'sphinx_rtd_theme', 'pyparsing', 'pyperclip', 'six'] setup( diff --git a/tests/test_argparse.py b/tests/test_argparse.py index 02c1701b..7096848a 100644 --- a/tests/test_argparse.py +++ b/tests/test_argparse.py @@ -6,7 +6,7 @@ import argparse import pytest import cmd2 -import mock +from unittest import mock from conftest import run_cmd, StdOut diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 339dbed9..2da75f93 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -11,7 +11,7 @@ import sys import io import tempfile -import mock +from unittest import mock import pytest import six diff --git a/tests/test_completion.py b/tests/test_completion.py index b102bc0a..5e76aee6 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -13,7 +13,7 @@ import os import sys import cmd2 -import mock +from unittest import mock import pytest # Prefer statically linked gnureadline if available (for macOS compatibility due to issues with libedit) diff --git a/tests/test_transcript.py b/tests/test_transcript.py index f7b4a8f2..a579b04a 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -11,7 +11,7 @@ import sys import re import random -import mock +from unittest import mock import pytest import six @@ -11,7 +11,6 @@ setenv = [testenv:py34] deps = - mock pyparsing pyperclip pytest @@ -23,7 +22,6 @@ commands = py.test -v -n2 --forked [testenv:py35] deps = - mock pyparsing pyperclip pytest @@ -35,7 +33,6 @@ commands = py.test -v -n2 --forked [testenv:py35-win] deps = - mock pyparsing pyperclip pyreadline @@ -47,7 +44,6 @@ commands = py.test -v -n2 [testenv:py36] deps = codecov - mock pyparsing pyperclip pytest @@ -63,7 +59,6 @@ commands = [testenv:py36-win] deps = codecov - mock pyparsing pyperclip pyreadline @@ -77,7 +72,6 @@ commands = [testenv:py37] deps = - mock pyparsing pyperclip pytest |