Commit 3d54d4c
committed
Config: remove more test specific conditions
The `--cache` option could not be tested as the `Config` 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".
* First of all, the default setting is for the cache to be _off_, so by default, tests wouldn't use the cache anyhow.
* Second of all, the problem of interference from dev-user specific system-wide defaults was fixed by the introduction of the `ConfigDouble` and the `AbstractRealConfigTestCase`.
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 the `tearDown[AfterClass]()` method.
Note: one of the removed conditions also affected the `--parallel` option, but only for system-wide settings, not for CLI arguments.
Related to 9661 parent 19d4bb8 commit 3d54d4c
1 file changed
+10
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
658 | 657 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
663 | 661 | | |
664 | 662 | | |
665 | 663 | | |
| |||
817 | 815 | | |
818 | 816 | | |
819 | 817 | | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
| 818 | + | |
| 819 | + | |
824 | 820 | | |
825 | 821 | | |
826 | 822 | | |
| |||
928 | 924 | | |
929 | 925 | | |
930 | 926 | | |
931 | | - | |
932 | | - | |
933 | | - | |
| 927 | + | |
934 | 928 | | |
935 | 929 | | |
936 | 930 | | |
| |||
0 commit comments