Files
ardupilot/Tools/scripts/build_tests
Christian Clauss 22582bc6c9 Tools: Fix test_ccache.py to not confuse pytest discovery
`Tools/scripts/build_tests/test_ccache.py` has a filename that will make Pytest Discovery think that it should be tested.
* https://docs.pytest.org/en/stable/explanation/goodpractices.html#conventions-for-python-test-discovery

This script also has code ___at global scope___ that will fail if certain command line arguments are not provided.

The proposed change is to put that code under `if __name__ == "__main__":` so it will not be run at test time.
* https://docs.python.org/3/library/__main__.html

Search for `test_ccache`:
* https://github.com/search?q=repo%3AArduPilot%2Fardupilot%20test_ccache&type=code

How was this tested?
1. `pytest Tools/scripts/build_tests/test_ccache.py`
2. `pytest Tools`

Both of the above find no tests instead of crashing with a long, confusing error.
2025-06-22 16:51:40 -05:00
..