Skip to content

Commit 0f620e2

Browse files
committed
Add basic setup for hypothesis
I haven't used hypothesis with pytest and haven't run this but assuming it behaves like it does for unittest this is the expected setup.
1 parent 4d84857 commit 0f620e2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_player.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
from axelrod_fortran.player import Player
33
from ctypes import c_int
44

5+
from hypothesis import given
6+
from hypothesis.strategies import integers
7+
58

69
def test_init():
710
for strategy in all_strategies:
@@ -10,7 +13,10 @@ def test_init():
1013
assert player.original_function.restype == c_int
1114

1215

13-
def test_strategy():
16+
@given(last_move=integers(min_value=0, max_value=1),
17+
score=integers(min_value=0, max_value=200))
18+
def test_strategy(last_move, score):
19+
print(last_move, score)
1420
for strategy in all_strategies:
1521
player = Player(strategy)
1622

0 commit comments

Comments
 (0)