The first example in the instructions append gets the logic inverted in the comment (line 19):
# Example when player X goes before player O.
raise ValueError("Wrong turn order: O started")
# Example when player X goes twice.
raise ValueError("Wrong turn order: X went twice")
# Example when player X wins AND player O wins.
raise ValueError("Impossible board: game should have ended after the game was won")
Player X should start, so the error is when O goes before X. The error message is correct, the comment above it is wrong.