From d78a6f1699d162a15321dc836493e0ea0ead88b5 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Wed, 27 Sep 2017 10:38:42 +0200 Subject: [PATCH] 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 --- setup.py | 2 +- test/test_printer_file.py | 5 +++-- tox.ini | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index f76e8d2..0d92127 100755 --- a/setup.py +++ b/setup.py @@ -132,7 +132,7 @@ setup( 'nose', 'scripttest', 'mock', - 'hypothesis<=3.28.3', + 'hypothesis', 'flake8' ], cmdclass={'test': Tox}, diff --git a/test/test_printer_file.py b/test/test_printer_file.py index b69617b..213f825 100644 --- a/test/test_printer_file.py +++ b/test/test_printer_file.py @@ -27,6 +27,7 @@ else: mock_open_call = '__builtin__.open' +@settings(use_coverage=False) @given(path=text()) def test_load_file_printer(mocker, path): """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") -@settings(deadline=None) +@settings(deadline=None, use_coverage=False) @given(txt=text()) def test_auto_flush(mocker, txt): """test auto_flush in file-printer""" @@ -58,7 +59,7 @@ def test_auto_flush(mocker, txt): assert mock_device.flush.called -@settings(deadline=None) +@settings(deadline=None, use_coverage=False) @given(txt=text()) def test_flush_on_close(mocker, txt): """test flush on close in file-printer""" diff --git a/tox.ini b/tox.ini index 174cd85..a61a4a8 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ deps = nose pytest!=3.2.0 pytest-cov pytest-mock - hypothesis<=3.28.3 + hypothesis viivakoodi commands = py.test --cov escpos