Refactor some unit and regression tests for speed improvements (#8970)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled

* Reduce history unit tests duration

* Unit and regression tests speed improvements

* Minor change

* Fix unit test race condition
This commit is contained in:
Jhonathan Abreu
2025-09-12 10:15:09 -04:00
committed by GitHub
parent 5b465216f9
commit 5644520545
16 changed files with 219 additions and 144 deletions
@@ -34,13 +34,17 @@ class PeriodBasedHistoryRequestNotAllowedWithTickResolutionRegressionAlgorithm(Q
"Tick history call with symbol array with explicit tick resolution")
history = self.history[Tick](spy, TimeSpan.from_hours(12))
if len(list(history)) == 0:
# Check whether history has data without enumerating the whole list
if not any(x for x in history):
raise AssertionError("On history call with implicit tick resolution: history returned no results")
history = self.history[Tick](spy, TimeSpan.from_hours(12), Resolution.TICK)
if len(list(history)) == 0:
if not any(x for x in history):
raise AssertionError("On history call with explicit tick resolution: history returned no results")
# We already tested what we wanted to test, we can quit now
self.quit()
def assert_that_history_throws_for_tick_resolution(self, history_call, history_call_description):
try:
history_call()