completely fix tests

The feature use_coverage of hypothesis caused the failing tests, because
the printer_file_test is sensitive to the coverage analysis of
hypothesis.

Fixed by disabling use_coverage for the crashing tests
This commit is contained in:
Patrick Kanzler 2017-09-27 10:38:42 +02:00
parent 5e784c060a
commit d78a6f1699
No known key found for this signature in database
GPG Key ID: F07F07153306FCEF
3 changed files with 5 additions and 4 deletions

View File

@ -132,7 +132,7 @@ setup(
'nose', 'nose',
'scripttest', 'scripttest',
'mock', 'mock',
'hypothesis<=3.28.3', 'hypothesis',
'flake8' 'flake8'
], ],
cmdclass={'test': Tox}, cmdclass={'test': Tox},

View File

@ -27,6 +27,7 @@ else:
mock_open_call = '__builtin__.open' mock_open_call = '__builtin__.open'
@settings(use_coverage=False)
@given(path=text()) @given(path=text())
def test_load_file_printer(mocker, path): def test_load_file_printer(mocker, path):
"""test the loading of the file-printer""" """test the loading of the file-printer"""
@ -37,7 +38,7 @@ def test_load_file_printer(mocker, path):
mock_open.assert_called_with(path, "wb") mock_open.assert_called_with(path, "wb")
@settings(deadline=None) @settings(deadline=None, use_coverage=False)
@given(txt=text()) @given(txt=text())
def test_auto_flush(mocker, txt): def test_auto_flush(mocker, txt):
"""test auto_flush in file-printer""" """test auto_flush in file-printer"""
@ -58,7 +59,7 @@ def test_auto_flush(mocker, txt):
assert mock_device.flush.called assert mock_device.flush.called
@settings(deadline=None) @settings(deadline=None, use_coverage=False)
@given(txt=text()) @given(txt=text())
def test_flush_on_close(mocker, txt): def test_flush_on_close(mocker, txt):
"""test flush on close in file-printer""" """test flush on close in file-printer"""

View File

@ -10,7 +10,7 @@ deps = nose
pytest!=3.2.0 pytest!=3.2.0
pytest-cov pytest-cov
pytest-mock pytest-mock
hypothesis<=3.28.3 hypothesis
viivakoodi viivakoodi
commands = py.test --cov escpos commands = py.test --cov escpos