https://pantsbuild.org/ logo
#development
Title
# development
w

wide-midnight-78598

12/19/2022, 2:08 PM
Is there a structure to follow for tests that expect a system binary, but that binary may not be available on everyone's machines? e.g. clang or gcc
h

hundreds-father-404

12/19/2022, 2:08 PM
like
@pytest.mark.skipif(not shutil.which("binary"))
?
❤️ 1
w

wide-midnight-78598

12/19/2022, 2:09 PM
Ooh, yes, exactly.
skipif
- haven't used that in a hot minute. Thanks!
h

hundreds-father-404

12/19/2022, 2:10 PM
I think we somehow have custom skip infrastructure, but I can't remember what it is. The idea is to fail eagerly in CI if a test can't run, but allow skipping on local
w

wide-midnight-78598

12/19/2022, 2:13 PM
I think I saw that months and months ago while jumping around source code, but completely evicted it from memory. I think GH's CI has us covered for this, but not going to make that assumption on developer machines I was trying to think of one of the backends that uses system binaries, and explicitly doesn't download the backend. Which led me to Go. I couldn't find the skip decorator - but I just found this:
@pytest.mark.no_error_if_skipped
I can use this if it makes more sense