这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@leomaurodesenv
Copy link
Owner

🧪 Add Test Coverage and Refactor Tests

Description

This pull request introduces test coverage reporting to the project using pytest-cov. It also refactors the existing test suite to use modern pytest practices, making the tests cleaner, more maintainable, and easier to expand.

The primary goal is to ensure that all code in the library is executed during testing, which increases confidence in its correctness and helps identify any untested logic.

Key Changes

  • Added Test Coverage:

    • The pytest-cov package has been added to the development dependencies.
    • pyproject.toml is now configured to automatically generate a coverage report for the sksampling package whenever pytest is run.
  • Test Refactoring:

    • The test functions in tests/test_sampling.py have been refactored to use pytest.mark.parametrize.
    • This change consolidates multiple assertions into a single, data-driven test, which improves readability and makes it trivial to add new test cases in the future.
  • Project Modernization:

    • The pyproject.toml file has been updated to use the standard [build-system] table and [project.optional-dependencies] for development dependencies, aligning the project with modern Python packaging conventions.

@leomaurodesenv leomaurodesenv self-assigned this Jun 28, 2025
@leomaurodesenv leomaurodesenv added the enhancement New feature or request label Jun 28, 2025
@leomaurodesenv leomaurodesenv merged commit 8c34ced into main Jun 28, 2025
2 checks passed
@leomaurodesenv leomaurodesenv deleted the feat/test-coverage branch June 28, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants