Fix a test ordering and state leak issues affecting tool/logging tests.
Review Request #12399 — Created June 21, 2022 and submitted
Depending on the order in which tests were run, the new
Toolconflict
tests intest_registrywould fail. One failure had to do with the
presence or lack ofToolobjects in the database, and the other had to
do with anassertLogs()failing to catch logged warnings.There were three issues behind these. One was a failure in the test, and
two were state consistency issues:
The new unit test needed
Toolobjects but failed to use the proper
fixture. This wasn't caught initially due to the next issue.
Toolobjects were sometimes populated when not needed by a unit
test, and could be populated at different levels of test setup,
causing state inconsistency depending on which tests were run first.
The solution to this is to avoid automatically populatingTool
objects inSCMToolRegistrywhen running unit tests, allowing the
previous fixture behavior to work as it did before, and to populate
at the right times.A unit test in
test_review.pyglobally disabled warnings. I can't
determine why it did this, but it was likely for very old historical
reasons. This affected subsequent tests. This code has now been
removed.
Tested full test runs and various combinations of suites. All the ones
that failed before pass now.
| Summary | ID |
|---|---|
| 667a7674f949867e636a9e26a01c5a2ddc3762ef |
| Description | From | Last Updated |
|---|---|---|
|
So the use of @add_fixtures(['test_scmtools']) and fixtures = ['test_scmtools'] work as they did before? Does this mean they are no … |
|