diff options
author | Anthon van der Neut <anthon@mnt.org> | 2015-01-12 18:01:52 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2015-01-12 18:01:52 +0100 |
commit | 680b278b1da87bd5bd6ef5c84f24e59f9a7ed23a (patch) | |
tree | 31620ef87264816b4a493ec5b9d79c7dbc068543 | |
parent | 61cb7871d0f2824b99b45ff0eeba67ee8ae90972 (diff) | |
download | ruamel.std.argparse-680b278b1da87bd5bd6ef5c84f24e59f9a7ed23a.tar.gz |
better message when running tests without installing package
-rw-r--r-- | README.rst | 8 | ||||
-rw-r--r-- | test/test_argparse.py | 6 | ||||
-rw-r--r-- | test/test_program.py | 5 |
3 files changed, 17 insertions, 2 deletions
@@ -331,3 +331,11 @@ If you provide a True value to the optional help_all parameter for then the commandline is checked for the option ``--help-all`` and the global help is printed, follow by the help for each sub parsers, separated by a dashed line. + +Testing +------- + +Testing is done using the `tox <https://pypi.python.org/pypi/tox>`_, which +uses `virtualenv <https://pypi.python.org/pypi/virtualenv>`_ and +`pytest <http://pytest.org/latest/>`_. + diff --git a/test/test_argparse.py b/test/test_argparse.py index 6c3d765..9cc818b 100644 --- a/test/test_argparse.py +++ b/test/test_argparse.py @@ -3,7 +3,11 @@ import pytest -from ruamel.std.argparse import argparse, CountAction, SmartFormatter +try: + from ruamel.std.argparse import argparse, CountAction, SmartFormatter +except ImportError: + print("you have to install ruamel.std.argparse to run the tests") + from textwrap import dedent diff --git a/test/test_program.py b/test/test_program.py index 4ac1706..3d98b03 100644 --- a/test/test_program.py +++ b/test/test_program.py @@ -7,7 +7,10 @@ from __future__ import print_function import sys import pytest -from ruamel.std.argparse import ProgramBase, option, sub_parser, version +try: + from ruamel.std.argparse import ProgramBase, option, sub_parser, version +except ImportError: + print("you have to install ruamel.std.argparse to run the tests") class Program(ProgramBase): |