ichabod801 / t_games

A collection of command-line interface games written in Python.
GNU General Public License v3.0
21 stars 4 forks source link

Rerun the unit testing. #579

Closed ichabod801 closed 4 years ago

ichabod801 commented 4 years ago

I've made a lot of changes. Make sure I didn't mess up any of the unit tests.

ichabod801 commented 4 years ago

Ouch. 26 failures, 251 errors on the first run. It looks like card related issues. Didn't I fix the tests after making those modifications? I'm afraid that I didn't.

ichabod801 commented 4 years ago

All righty then. Go through them one test file at a time.

ichabod801 commented 4 years ago

Fixed backgammon.py, which had over 85 errors, so that's a good chunk of them.

ichabod801 commented 4 years ago

Now I remember why the tests are all messed up. I didn't check the unit tests after v0.50.51a1 because I knew there was a play test release (this release) coming after it. I figured I could deal with it during the play test release. Well, here I am, dealing with it.

ichabod801 commented 4 years ago

The last problem with Battleships is that bots return coordinates from ask, and humans return strings. This makes it impossible to have tournament, because the human becomes a bot returning the wrong thing.

ichabod801 commented 4 years ago

The Battleships unit tests are fixed, removing 21 failures and 14 errors.

ichabod801 commented 4 years ago

All the unit tests through crazy_eights_test.py have no failures or errors.

ichabod801 commented 4 years ago

Finished with cribbage_test.py, which removes 45 errors.

ichabod801 commented 4 years ago

Finished through game_test.py, which removes 5 errors.

ichabod801 commented 4 years ago

Cleaning up gin_rummy_test.py removes 5 failures and 5 errors.

ichabod801 commented 4 years ago

Currently in interface_test.py, I'm getting intermittent errors, one to three per run. These are in the interface command test, with invalid replies in AutoBot.ask_yes_no. I think when I wrote this I didn't know what questions to expect, so I just kept throwing things at the interface until something worked. Perhaps try making AutoBot.ask_yes_no more forgiving somehow.

ichabod801 commented 4 years ago

Everything up through player_test.py tests out fine. However, prisoner_test.py has 73 errors. It looks like the calls to the bots are all flawed because of the way I rewrote them.

ichabod801 commented 4 years ago

I made one minor change to prisoner_game.py while fixing prisoner_test.py: I made sure all the bots used the full 'cooperate' or 'defect' as moves, not just 'c' and 'd'. This actually only applied to the GradualBot. It's also invisible to the user.

ichabod801 commented 4 years ago

All tests now run without error or failure in 3.6.

ichabod801 commented 4 years ago

I'm getting two errors in 2.7 in interface_test.py. Both are when getting statistics for a game using an alias. However, they only occur when I run _test_all.py and not when I run interface_test.py. Also, getting stats by alias works fine in the interface in 2.7. I have no idea what the problem is, but it's a problem with unittest, so I'm going to ignore it.