keleshev / docopt-dispatch

Dispatch from command-line arguments to functions
MIT License
20 stars 2 forks source link

tests fail on python 3.x due to use of .message member of Exception #5

Open tbarron opened 6 years ago

tbarron commented 6 years ago
(venv) > $ py.test                                                                       [±ordict ●]
======================================== test session starts ========================================
platform darwin -- Python 3.6.1, pytest-3.0.7, py-1.5.2, pluggy-0.4.0 -- /Users/tbarron/.pyenv/versions/3.6.1/bin/python3.6
cachedir: .cache
rootdir: /Users/tbarron/prj/github/docopt-dispatch, inifile: pytest.ini
plugins: cov-2.5.1
collected 5 items

test_docopt_dispatch.py::test_dispatch_can_dispatch_on_option FAILED

============================================= FAILURES ==============================================
_______________________________ test_dispatch_can_dispatch_on_option ________________________________
test_docopt_dispatch.py:35: in test_dispatch_can_dispatch_on_option
    assert error.value.message == {'option': True, 'argument': None}
E   AttributeError: 'OptionMarker' object has no attribute 'message'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================== 1 failed in 0.45 seconds ======================================

Using .args[0] rather than .message will work for both python 2.x and python 3.x