Skip to content

Refactor test_base.py to pytest style (#1351)#1786

Open
EshaSharma28 wants to merge 1 commit into
automl:developmentfrom
EshaSharma28:development
Open

Refactor test_base.py to pytest style (#1351)#1786
EshaSharma28 wants to merge 1 commit into
automl:developmentfrom
EshaSharma28:development

Conversation

@EshaSharma28
Copy link
Copy Markdown

Summary

This PR refactors test/test_pipeline/test_base.py to use modern pytest functional styles instead of the legacy unittest.TestCase structure, addressing #1351.

Changes

  • Replaced the class-based BaseTest(unittest.TestCase) structure with independent test functions:
    • test_get_hyperparameter_configuration_space_3choices()
    • test_init_params_handling()
    • test_include_exclude_validation()
  • Converted all legacy self.assertEqual assertions to standard Python assert statements.
  • Replaced self.assertRaises / self.assertRaisesRegex context managers with pytest.raises.
  • Cleaned up imports, removing unittest.

Verification

Ran tests successfully with pytest:

PYTHONPATH=. python3 -m pytest test/test_pipeline/test_base.py

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.

1 participant