Revert use of hypothesis

This commit is contained in:
Markus Unterwaditzer 2018-01-21 23:22:22 +01:00
parent 45d76c889c
commit 82f47737a0
2 changed files with 10 additions and 26 deletions

View file

@ -1,9 +1,7 @@
import pytest
import json import json
from textwrap import dedent from textwrap import dedent
import hypothesis.strategies as st
from hypothesis import given
from vdirsyncer import exceptions from vdirsyncer import exceptions
from vdirsyncer.storage.base import Storage from vdirsyncer.storage.base import Storage
@ -176,7 +174,8 @@ def test_null_collection_with_named_collection(tmpdir, runner):
assert 'HAHA' in bar.read() assert 'HAHA' in bar.read()
@given(a_requires=st.booleans(), b_requires=st.booleans()) @pytest.mark.parametrize('a_requires,b_requires',
[(x, y) for x in (0, 1) for y in (0, 1)])
def test_collection_required(a_requires, b_requires, tmpdir, runner, def test_collection_required(a_requires, b_requires, tmpdir, runner,
monkeypatch): monkeypatch):

View file

@ -4,9 +4,6 @@ import json
import sys import sys
from textwrap import dedent from textwrap import dedent
import hypothesis.strategies as st
from hypothesis import example, given
import pytest import pytest
from tests import format_item from tests import format_item
@ -275,25 +272,13 @@ def test_multiple_pairs(tmpdir, runner):
# XXX: https://github.com/pimutils/vdirsyncer/issues/617 # XXX: https://github.com/pimutils/vdirsyncer/issues/617
@pytest.mark.skipif(sys.platform == 'darwin', @pytest.mark.xfail(sys.platform == 'darwin',
reason='This test inexplicably fails') reason='This test inexplicably fails')
@given(collections=st.sets( @pytest.mark.parametrize('collections', [
st.text( {'persönlich'},
st.characters( {'a', 'A'},
blacklist_characters=set( {'\ufffe'},
u'./\x00' # Invalid chars on POSIX filesystems ])
),
# Surrogates can't be encoded to utf-8 in Python
blacklist_categories=set(['Cs'])
),
min_size=1,
max_size=50
),
min_size=1
))
@example(collections=[u'persönlich'])
@example(collections={'a', 'A'})
@example(collections={'\ufffe'})
def test_create_collections(subtest, collections): def test_create_collections(subtest, collections):
@subtest @subtest