daffidwilde / matching

A package for solving matching games
https://daffidwilde.github.io/matching/
MIT License
150 stars 42 forks source link

Fix flaky `Player.forget()` behaviour #88

Closed daffidwilde closed 4 years ago

daffidwilde commented 4 years ago

Occasionally test_second_phase would fail due to a repeated pair in an all-or-nothing cycle unless the try-except block is included in Player.forget(). However, this would never really happen in SR so an example can't be found and 100% coverage becomes flaky.

So, this PR removes the block (since it isn't needed) and adds ValueError to the exceptions in test_second_phase. This is a quick fix and perhaps a more appropriate solution is to make our own MatchingError exceptions?