-
Notifications
You must be signed in to change notification settings - Fork 75
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
Fix TypeError on YAML test execution with trace option #1299
base: master
Are you sure you want to change the base?
Conversation
Allows for parent parameter transmission at TestItem init
By giving a value ahead aka to path
Rebasing to get #1297. This should fix current |
7076ff3
to
08c878a
Compare
…th on private method
And do not init simulation before TestItem.runtest that will instanciate it with trace options
…tionLog.print_log
Rebasing on top of #1297 didn't fix the issue: Fixed in last commits and the same fix also comes with open #1304. 🐛 The issue seems to have started with #1185: |
|
||
def _get_node_log( | ||
self, | ||
node: t.TraceNode, | ||
depth: int, | ||
aggregate: bool, | ||
max_depth: int = sys.maxsize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default value removed as
_get_node_log
shouldn't be called outsideopenfisca_core
(as its name starting with_
suggests). So wouldn't a change of themax_depth
option value here produce unexpected behaviors for code calling the publicopenfisca_core
?
super().__init__("", TestFile(), TaxBenefitSystem(), test, {}) | ||
|
||
self.tax_benefit_system = self.baseline_tax_benefit_system | ||
self.simulation = Simulation() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed to call the default constructor.
Simulation()
used once only intest_variable_not_found
.
@@ -191,6 +230,33 @@ def test_performance_tables_option_output() -> None: | |||
clean_performance_files(paths) | |||
|
|||
|
|||
def test_verbose_option_output(capsys) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test used to debug the
TypeError
fixed by this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but since there are many things I do not understand, I will let the last word to pros like @bonjourmauko or @guillett
Connected to #1293 issue
Connected to openfisca/openfisca-france#2387 issue
And contains same fix as in #1304 issue (adds tests)
Bug fix
print_computation_log()
for YAML tests withverbose
optionmax_depth
and fixesTypeError
onopenfisca test -v file.yaml
command introduced in openfisca-core41.5.6