Standardize tests for memoryone and memorytwo files. #1333
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The memoryone and memorytwo strategy files were doing some unusual things in the test files. It seems like they were trying to duplicate some functionality in Player's repr and in TestPlayers tests. This was causing problems with Classifiers logic. Details:
Code was changing name on initialization to include the parameter that the strategy was used with. name is only used in two places: for repr and for Classifiers. repr already attaches the initialization parameters, and Classifiers was getting messed up because instances had a different name than the class. By making this change we make the strategy behave consistently with other strategies.
I removed test_name from these unittests because this is covered by test_repr in TestPlayer. It's true that test_play in these tests covers repr for strategies initialized with specific parameters, but we can rely on the unittests that cover a general Player's repr logic.
I removed classifier tests in these files. We see in #1330 that we had to update classifier tests. We can update here too, but it'd be redundant and hard to maintain to continue to have these tests listed special.