Config: remove more test specific conditions #1068
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
--cache
option could not be tested as theConfig
class did not allow for it to be set in a test situation.This "conditional ignore" was introduced in commit 24c7a7f around the same time the caching feature was introduced. The commit message doesn't give a reason for introducing the conditional ignore. I can only guess why and my guess would be that it was to prevent test runs being influence by dev-user specific system-wide defaults from a
CodeSniffer.conf
file.In my opinion, that is not a good reason for keeping the "conditional ignore".
ConfigDouble
and theAbstractRealConfigTestCase
.All in all, I think these conditions can be safely removed.
Do keep in mind though that subsequent test runs for tests involving caching may re-use the cache from an earlier run test.
To prevent that, set an explicit cacheFile for the test using
--cache=<filename>
and remove this cache file after running the test(s) via thetearDown[AfterClass]()
method.Note: one of the removed conditions also affected the
--parallel
option, but only for system-wide settings, not for CLI arguments.Suggested changelog entry
N/A
Related issues/external references
Related to #966