Skip to content

Commit 5f65a37

Browse files
ch3pjwhoefling
authored andcommitted
Remove hypothesis from callback testing
1 parent 91730b2 commit 5f65a37

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

tests/test_main.py

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from io import BytesIO
55

6-
from hypothesis import given, strategies
76
import pytest
87
from tests import base
98

@@ -43,20 +42,6 @@ def setUp(self):
4342
super().setUp()
4443
xmlsec.cleanup_callbacks()
4544

46-
@given(funcs=strategies.lists(
47-
strategies.sampled_from([
48-
lambda: None
49-
# xmlsec.cleanup_callbacks,
50-
# xmlsec.register_default_callbacks,
51-
])
52-
))
53-
def test_arbitrary_cleaning_and_default_callback_registration(self, funcs):
54-
# FIXME: This test seems to detelct unreferenced objects and memory
55-
# leaks even if it never does anything!
56-
pass
57-
# for f in funcs:
58-
# f()
59-
6045
def _sign_doc(self):
6146
root = self.load_xml("doc.xml")
6247
sign = xmlsec.template.create(
@@ -122,26 +107,20 @@ def test_sign_data_from_callbacks(self):
122107
self._register_match_callbacks()
123108
self._verify_external_data_signature()
124109

125-
@given(
126-
num_prior_mismatches=strategies.integers(min_value=1, max_value=50),
127-
num_post_mismatches=strategies.integers(min_value=1, max_value=50),
128-
)
129-
def test_sign_data_not_first_callback(
130-
self, num_prior_mismatches, num_post_mismatches
131-
):
110+
def test_sign_data_not_first_callback(self):
132111
bad_match_calls = 0
133112

134113
def match_cb(filename):
135114
nonlocal bad_match_calls
136115
bad_match_calls += 1
137116
False
138117

139-
for _ in range(num_post_mismatches):
118+
for _ in range(2):
140119
self._register_mismatch_callbacks(match_cb)
141120

142121
self._register_match_callbacks()
143122

144-
for _ in range(num_prior_mismatches):
123+
for _ in range(2):
145124
self._register_mismatch_callbacks()
146125

147126
self._verify_external_data_signature()

0 commit comments

Comments
 (0)