Commits

Andy Mikhailenko  committed eb2741b

Add test coverage script. Fix formatting and other minor stuff all over the place.

  • Participants
  • Parent commits 7a70ed6

Comments (0)

Files changed (12)

 ^\.coverage
 ^cover/
 ,cover$
+^htmlcov/
 
 ^\.tox/
 

File argh/decorators.py

     return wrapper
 
 
-def alias(new_name):
+def alias(new_name):  # pragma: nocover
     """
     .. deprecated:: 0.19
 
     return wrapper
 
 
-def plain_signature(func):
+def plain_signature(func):  # pragma: nocover
     """
     .. deprecated:: 0.20
 
+py.test --cov argh --cov-report term --cov-report html "$@" \
+    && uzbl-browser htmlcov/index.html
         'Topic :: Software Development :: User Interfaces',
         'Topic :: Software Development :: Libraries :: Python Modules',
     ],
-
-    # release sanity check
-    test_suite = 'nose.collector',
 )

File test/__init__.py

Empty file added.

File test/test_assembling.py

 
 import argh
 
-from base import DebugArghParser, run
+from .base import DebugArghParser, run
 
 
 def test_default_command():

File test/test_decorators.py

 
 import argh
 
-from base import DebugArghParser, run
+from .base import DebugArghParser, run
 
 
 def test_command_decorator():

File test/test_dispatching.py

 """
 import argh
 
-from base import make_IO
+from .base import make_IO
 
 
 def _dispatch_and_capture(func, command_string, **kwargs):

File test/test_everything.py

 
 import argh
 
-from base import (DebugArghParser, assert_cmd_regex,
-                  assert_cmd_fails, assert_cmd_doesnt_fail, run)
+from .base import (DebugArghParser, assert_cmd_regex,
+                   assert_cmd_fails, assert_cmd_doesnt_fail, run)
 
 
 def test_argv():

File test/test_interaction.py

 import argh
 
 
-def assert_choice(choice, expected, **kwargs):
-    argh.io._input = lambda prompt: choice
-    assert expected == argh.confirm('test', **kwargs)
-
 def parse_choice(choice, **kwargs):
     argh.io._input = lambda prompt: choice
     return argh.confirm('test', **kwargs)
 
+
 def test_simple():
     assert None == parse_choice('')
     assert None == parse_choice('', default=None)
 
     assert None == parse_choice('x') == None
 
+
 def test_prompt():
     "Prompt is properly formatted"
     prompts = []
     argh.confirm('do smth', default=False)
     assert prompts[-1] == 'do smth? (y/N)'
 
+
 def test_encoding():
     "Unicode and bytes are accepted as prompt message"
     def raw_input_mock(prompt):

File test/test_regressions.py

 ~~~~~~~~~~~~~~~~
 """
 from argh import command
-from base import DebugArghParser, assert_cmd_fails, assert_cmd_exits, run
+from .base import DebugArghParser, assert_cmd_fails, assert_cmd_exits, run
 
 
 def test_regression_issue12():
 [tox]
-envlist=py26,py27,pypy,py32,py33,py-xdist
-indexserver=
-default=http://pypi.python.org/simple
+envlist=py26,py27,py32,py33,pypy
 
 [testenv]
-deps = pytest       # PYPI package providing py.test
-commands =
-  py.test []
+deps=pytest         # PYPI package providing py.test
+commands=
+    py.test []
 
 [testenv:py26]
-deps =
+deps=
     pytest
     argparse        # not shipped with Python < 2.7
 
 [testenv:tdd]
-# special case for active development phase.
-# tox's native Python interpreter is used because who cares.
+# Special case for active development phase.
 basepython=python3.2
-deps={[testenv]deps}
-     pytest-xdist
+deps=
+    {[testenv]deps}
+    pytest-xdist
 commands=
     py.test --exitfirst --looponfail []