From 3070096c9c7d174fc040e4a5af04ea831fe6dea2 Mon Sep 17 00:00:00 2001 From: c4f3a0ce <30480807+c4f3a0ce@users.noreply.github.com> Date: Sun, 8 Dec 2019 13:04:51 +0100 Subject: [PATCH] Skip test if Python 2 --- tests/test_trie.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/test_trie.py b/tests/test_trie.py index c664304..f9b728e 100644 --- a/tests/test_trie.py +++ b/tests/test_trie.py @@ -427,17 +427,20 @@ def test_trie_fuzzy(): def test_trie_handles_long_alphabets(): # https://github.com/pytries/datrie/issues/74 + import sys import hypothesis.strategies as st from hypothesis import given - alphabet = [chr(i) for i in range(1500)] - @given(st.lists(st.text(alphabet))) - def _(xs): - trie = datrie.Trie(alphabet) - for x in xs: - trie[x] = True + sys.version_info > (2, ): - for x in xs: - assert x in trie + alphabet = [chr(i) for i in range(1500)] + @given(st.lists(st.text(alphabet))) + def _(xs): + trie = datrie.Trie(alphabet) + for x in xs: + trie[x] = True - _() + for x in xs: + assert x in trie + + _()