Skip to content

Commit f901a76

Browse files
committed
Cleanup of tests
1 parent fe705e1 commit f901a76

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ install:
2020
- pip install -r requirements.txt
2121
- pip install pytest
2222
script:
23-
- pytest
23+
- pytest tests/

tests/test_player.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ def test_implemented_strategies():
134134
opponent = opponent_strategy()
135135
axl_match = Match((axl_player, opponent))
136136
axl_interactions = axl_match.play()
137-
print(player, axl_player, opponent)
138-
print(interactions)
139-
print(axl_interactions)
140137
assert interactions == axl_interactions
141138

142139

@@ -146,12 +143,11 @@ def test_champion_v_alternator():
146143
"""
147144
player = Player("k61r")
148145
opponent = Alternator()
149-
match = Match((player, opponent))
150-
151146
seed = 0
152-
interactions = match.play(seed=seed)
147+
match = Match((player, opponent), seed=seed)
148+
interactions = match.play()
153149
assert interactions[25:30] == [(C, D), (C, C), (C, D), (D, C), (C, D)]
154-
assert interactions == match.play(seed=seed)
150+
assert interactions == match.play()
155151

156152

157153
def test_warning_for_self_interaction(recwarn):
@@ -197,10 +193,7 @@ def test_match_reproducibility():
197193
players2 = [Player(strategy) for strategy in strategies]
198194
match2 = Match(players2, turns=200, noise=0.1, seed=seed)
199195
results2 = match2.play()
200-
if results1 != results2:
201-
print(strategies)
202-
print(results1)
203-
print(results2)
196+
204197
assert (results1 == results2)
205198

206199

@@ -218,11 +211,3 @@ def test_tournament_reproducibility():
218211

219212
assert (results1.ranked_names == results2.ranked_names)
220213

221-
222-
if __name__ == "__main__":
223-
test_init()
224-
test_matches()
225-
test_noisy_matches()
226-
# test_implemented_strategies()
227-
test_match_reproducibility()
228-
test_tournament_reproducibility()

0 commit comments

Comments
 (0)