Skip to content

refactor: use mock_timeit utility in categorical timeit test - #1219

Open
ovodela wants to merge 1 commit into
capitalone:devfrom
ovodela:refactor/categorical-timeit-tests
Open

refactor: use mock_timeit utility in categorical timeit test#1219
ovodela wants to merge 1 commit into
capitalone:devfrom
ovodela:refactor/categorical-timeit-tests

Conversation

@ovodela

@ovodela ovodela commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • Replaces the manual time.time patch (hardcoded float array with .pop()) in test_timeit_profile with the shared test_utils.mock_timeit() context manager
  • This makes the test consistent with other timeit tests in the same file (lines 940, 1004) and across the codebase
  • Removes the now-unused from unittest.mock import patch import
  • No behavioral change: the expected timing values (1.0 after first update, 2.0 after second) are identical

Test plan

  • test_timeit_profile passes with the new mock
  • No other tests in the file are affected (only import and one test method changed)
  • The -3 line diff confirms this is a minimal, targeted refactor

Closes #806

Replace the manual time.time patch with a hardcoded float array with
the shared test_utils.mock_timeit() context manager, consistent with
other tests in the same file (lines 940, 1004) and across the codebase.

Also removes the now-unused unittest.mock.patch import.

Closes capitalone#806
@ovodela
ovodela requested a review from a team as a code owner August 31, 2026 22:27
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