1
1
"""Test constants from :mod:`xmlsec.constants` module."""
2
2
3
- from hypothesis import given , strategies
3
+ import pytest
4
4
5
5
import xmlsec
6
6
@@ -18,25 +18,25 @@ def _constants(typename):
18
18
)
19
19
20
20
21
- @given ( transform = strategies . sampled_from ( _constants ('__Transform' )) )
21
+ @pytest . mark . parametrize ( 'transform' , _constants ('__Transform' ), ids = repr )
22
22
def test_transform_str (transform ):
23
23
"""Test string representation of ``xmlsec.constants.__Transform``."""
24
24
assert str (transform ) == '{}, {}' .format (transform .name , transform .href )
25
25
26
26
27
- @given ( transform = strategies . sampled_from ( _constants ('__Transform' )) )
27
+ @pytest . mark . parametrize ( 'transform' , _constants ('__Transform' ), ids = repr )
28
28
def test_transform_repr (transform ):
29
29
"""Test raw string representation of ``xmlsec.constants.__Transform``."""
30
30
assert repr (transform ) == '__Transform({!r}, {!r}, {})' .format (transform .name , transform .href , transform .usage )
31
31
32
32
33
- @given ( keydata = strategies . sampled_from ( _constants ('__KeyData' )) )
33
+ @pytest . mark . parametrize ( 'keydata' , _constants ('__KeyData' ), ids = repr )
34
34
def test_keydata_str (keydata ):
35
35
"""Test string representation of ``xmlsec.constants.__KeyData``."""
36
36
assert str (keydata ) == '{}, {}' .format (keydata .name , keydata .href )
37
37
38
38
39
- @given ( keydata = strategies . sampled_from ( _constants ('__KeyData' )) )
39
+ @pytest . mark . parametrize ( 'keydata' , _constants ('__KeyData' ), ids = repr )
40
40
def test_keydata_repr (keydata ):
41
41
"""Test raw string representation of ``xmlsec.constants.__KeyData``."""
42
42
assert repr (keydata ) == '__KeyData({!r}, {!r})' .format (keydata .name , keydata .href )
0 commit comments