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.
This commit is contained in:
Patrick Kanzler 2017-09-27 10:22:46 +02:00
parent 1439b14686
commit 5e784c060a
No known key found for this signature in database
GPG Key ID: F07F07153306FCEF
3 changed files with 5 additions and 3 deletions

View File

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

View File

@ -16,7 +16,7 @@ from __future__ import unicode_literals
import six import six
import pytest import pytest
from hypothesis import given from hypothesis import given, settings
from hypothesis.strategies import text from hypothesis.strategies import text
import escpos.printer as printer import escpos.printer as printer
@ -37,6 +37,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)
@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"""
@ -57,6 +58,7 @@ def test_auto_flush(mocker, txt):
assert mock_device.flush.called assert mock_device.flush.called
@settings(deadline=None)
@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 hypothesis<=3.28.3
viivakoodi viivakoodi
commands = py.test --cov escpos commands = py.test --cov escpos