Skip to content

Restore data folder from Globals in tests - #9834

Merged
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
Martin-Molinero:test-data-folder-restore
Sep 25, 2026
Merged

Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
Martin-Molinero:test-data-folder-restore

Conversation

@Martin-Molinero

@Martin-Molinero Martin-Molinero commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Description

Minor test refactor: tests that temporarily point the data folder somewhere else (SymbolPropertiesDatabaseTests, RandomDataGeneratorTests) now save the original value from Globals.DataFolder instead of reading the data-folder config key again.

Globals.DataFolder is the data folder actually in use, including the default when the key isn't set. Restoring from it puts the global state back the way it was, so later tests in the same run aren't affected.

Related Issue

N/A

Motivation and Context

Makes the save/restore in these tests independent of how the config value is resolved, so they can't leave a different data folder behind for later tests.

Requires Documentation Change

No

How Has This Been Tested?

Ran SymbolPropertiesDatabaseTests and RandomDataGeneratorTests together with the regression tests that run after them (RunRemoveConsolidatorsRegressionAlgorithm, IncrementalOrderId): 62/62 pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

🤖 Generated with Claude Code

Tests that temporarily change the data folder now capture the original
value from Globals.DataFolder instead of re-reading the configuration.
Globals.DataFolder is the resolved value in use, including the default
applied when the key isn't set, so restoring it reliably returns the
global state to what it was before the test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Martin-Molinero
Martin-Molinero merged commit f49bb96 into QuantConnect:master Sep 25, 2026
5 of 8 checks passed
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