Skip to content

Fix deterministic and stochastic tournament tests, improve test structure, and update documentation/configuration #1462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

Mike014
Copy link

@Mike014 Mike014 commented Jan 7, 2025

This Pull Request addresses multiple improvements and fixes across the project:

Fixes:

  1. Fixed issues in test_tournament.py:
    • Corrected file naming for deterministic tests.
    • Added a pre-check to remove existing files before generating new ones.
  2. Improved test reliability:
    • Updated OpponentTest to use a static strategy method.
    • Renamed classes and adjusted test generation in test_makes_use_of.py and test_property.py.
  3. Enhanced performance:
    • Enabled parallel testing with pytest-xdist.
    • Reduced max_examples in Hypothesis-based tests to improve efficiency.
  4. Documentation updates:
    • Adjusted Makefile to handle warnings without failing.
  5. Configuration updates:
    • Added and updated dependencies in tox.ini and requirements.txt.

Impact:

  • Improved test stability and performance.
  • Enhanced maintainability and compatibility.
  • Updated documentation and streamlined build process.

Please review the changes and provide feedback. Thank you!

- Changed TestOpponent class to no longer use __init__ constructor
- This fixes the PytestCollectionWarning in axelrod/tests/strategies/test_player.py:353
- This modification allows the test to run without issues.

See also: #1440
…dGamePlayer class to MakesUseOfLengthAndGamePlayer in axelrod/tests/unit/test_makes_use_of.py to resolve PytestCollectionWarning.
- Fixed 'TestOpponent' import error in 'test_sequence_player.py'.
- Refactored test classes with '__init__' constructors to avoid PytestCollectionWarning.
- Addressed UserWarnings in 'test_memoryone.py' and 'test_memorytwo.py' related to default player settings.
- Handled seed reproducibility warning in 'test_player.py' to ensure deterministic test results.
- Investigated RuntimeWarning in 'test_zero_determinant.py' related to invalid division.
- Optimized test execution time by running tests in parallel using pytest-xdist.
- Addressed minor warnings related to test strategies and examples.
@marcharper
Copy link
Member

Are you using AI to generate these / are you a bot?

@marcharper marcharper closed this Jan 7, 2025
@Mike014
Copy link
Author

Mike014 commented Jan 7, 2025 via email

@Mike014
Copy link
Author

Mike014 commented Jan 7, 2025 via email

@Mike014
Copy link
Author

Mike014 commented Jan 7, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants