From 5e784c060a5e555787395d59342981c6cd1a33c9 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Wed, 27 Sep 2017 10:22:46 +0200 Subject: [PATCH] fix tests failing (for now) hypothesis introduced a regression in 3.29.0 (or at least changed behaviour). Until I have found the problem I will pin it to the last working version. Also two tests should be prevented from failing when they are slow. --- setup.py | 2 +- test/test_printer_file.py | 4 +++- tox.ini | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 0d92127..f76e8d2 100755 --- a/setup.py +++ b/setup.py @@ -132,7 +132,7 @@ setup( 'nose', 'scripttest', 'mock', - 'hypothesis', + 'hypothesis<=3.28.3', 'flake8' ], cmdclass={'test': Tox}, diff --git a/test/test_printer_file.py b/test/test_printer_file.py index 48b7606..b69617b 100644 --- a/test/test_printer_file.py +++ b/test/test_printer_file.py @@ -16,7 +16,7 @@ from __future__ import unicode_literals import six import pytest -from hypothesis import given +from hypothesis import given, settings from hypothesis.strategies import text import escpos.printer as printer @@ -37,6 +37,7 @@ def test_load_file_printer(mocker, path): mock_open.assert_called_with(path, "wb") +@settings(deadline=None) @given(txt=text()) def test_auto_flush(mocker, txt): """test auto_flush in file-printer""" @@ -57,6 +58,7 @@ def test_auto_flush(mocker, txt): assert mock_device.flush.called +@settings(deadline=None) @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 a61a4a8..174cd85 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ deps = nose pytest!=3.2.0 pytest-cov pytest-mock - hypothesis + hypothesis<=3.28.3 viivakoodi commands = py.test --cov escpos