Skip to content
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

Migrate to new test base, 4 #96

Merged
merged 6 commits into from
Oct 13, 2021
Merged

Migrate to new test base, 4 #96

merged 6 commits into from
Oct 13, 2021

Conversation

maread99
Copy link
Collaborator

@maread99 maread99 commented Oct 7, 2021

This PR conludes the migration to the new test base.

  • Migrates the final 30 calendar test modules.
  • Removes the old test base.
  • Renames new test base ExchangeCalendarTestBase.
  • Migrates other test classes on test_exchange_calendar.py to pytest.
  • Removes development requirement 'parameterized' (now redundant) from extras_require of setup.py.

Summary

  • The test base executes around three times as many tests per calendar than under the old base, although takes around the same time.
  • Tests now accommodate a calendar for each side option (where applicable).
  • Testing now places emphasis on edge cases, including previously ignored cases.
  • Subclassing ExchangeCalendarTestBase has been significantly simplified.
  • Test inputs are no longer generated by individual tests, but rather sourced from one of:
    • New Answers class which evaluates inputs from interrogation of a resources\*.csv file.
    • Fixtures defined on a ExchangeCalendarTestBase subclass to provide calendar specific inputs, for example regular_holidays_sample.
    • Fixtures defined directly on ExchangeCalendarTestBase (only for rare cases where a fixture requires some knowledge of the calendar, for example early_closes requires knowledge of the rule governing prevailing normal close times).
  • All tests now use native pytest framework.

Migrates following test modules to new test base:
- `test_xfra_calendar.py`
- `test_xhel_calendar.py`
- `test_xice_calendar.py`
- `test_xidx_calendar.py`
- `test_xist_calendar.py`
- `test_xjse_calendar.py`
- `test_xkar_calendar.py`
- `test_xkls_calendar.py`
- `test_xkrx_calendar.py`
- `test_xlim_calendar.py`

Also removes `xkrx_old.csv` from test resources.
Migrates following test modules to new test base:
- `test_xmad_calendar.py`
- `test_xmex_calendar.py`
- `test_xmil_calendar.py`
- `test_xmos_calendar.py`
- `test_xnys_calendar.py`
- `test_xnze_calendar.py`
- `test_xosl_calendar.py`
- `test_xphs_calendar.py`
- `test_xpra_calendar.py`
- `test_xses_calendar.py`

Also removes `xkrx_old.csv` from test resources.
Migrates following test modules to new test base:
- `test_xsgo_calendar.py`
- `test_xshg_calendar.py`
- `test_xsto_calendar.py`
- `test_xswx_calendar.py`
- `test_xtae_calendar.py`
- `test_xtai_calendar.py`
- `test_xtks_calendar.py`
- `test_xtse_calendar.py`
- `test_xwar_calendar.py`
- `test_xwbo_calendar.py`

Minor revision to `ExchangeCalendarTestBaseNew` tests:
- `test_late_opens`
- `test_early_closes`
This commit concludes migration to new test base.

Removes classes made redundant by new test base:
- `ExchangeCalendarTestBase` (previous test base)
- `OpenDetectionTestCase`
- `NoDSTExchangeCalendarTestBase`

Renames `ExchangeCalendarTestBaseNew` as `ExchangeCalendarTestBase`.
Migrates following test classes to pytest:
- `CalendarRegistrationTestCase` (renamed `TestCalendarRegistration`).
- `DefaultsTestCase` (made function and renamed
`test_default_calendars`).
- `DaysAtTimeTestCase` (made function and renamed  `test_days_at_time`).

`parameterized` development requirement now redundant:
-  removes `parameterized` from extras_require of `setup.py`.
@maread99 maread99 mentioned this pull request Oct 8, 2021
20 tasks
@maread99 maread99 marked this pull request as ready for review October 8, 2021 15:32
This was referenced Oct 8, 2021
Extends documentation for optionally implemented
`ExchangeCalendarTestBase` fixtures.
@gerrymanoim
Copy link
Owner

This is great! Thanks!

@maread99 maread99 merged commit 12b7d6b into master Oct 13, 2021
@maread99 maread99 deleted the test-migration-4 branch October 13, 2021 07:29
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