SHTK_UNITTEST_SKIP(3)
π SHTK_UNITTEST_SKIP(3) β the skip-it-sis era
okay so bestie, real talk: this is a page from the shtk manual, and it's all about the shtk_unittest_skip function. she's giving "I'm not failing, I'm just exiting the situation" and honestly? iconic behavior.
β¨ LIBRARY β¨
You get this one by importing the unittest module:
shtk_import unittest
no cap, that's the whole vibe. π
πΈ SYNOPSIS πΈ
shtk_unittest_skip [arg1 .. argN]
π DESCRIPTION π
So shtk_unittest_skip marks the test that's currently running as skipped, and then it just aborts execution, periodt. Like, she's done, she's leaving the group chat. π
The message you pass in arg1 through argN gets printed right alongside the skip condition, so future-you (and your besties) can see exactly why the test dipped out. π¦
Now here's the part that matters most, and it's lowkey the whole point: skipped tests do not count as failures. They're not a red flag, they're not a π moment. They just represent a test that can't successfully be executed, and so it's ignored. That's it, that's the vibe check. β¨
π₯ EXAMPLES π₯
picture this: a test case that needs a specific file to actually be present on the system. main character energy, but conditional:
shtk_unittest_add_test motd_contents
motd_contents_test() {
[ -f /etc/motd ] || skip "/etc/motd not found; cannot validate"
... do something with /etc/motd here ...
}
see how she checks first? [ -f /etc/motd ], and if that file's not there she hits skip with the message. no sadness club, no false failure, just a clean little bail. π«Ά
π SEE ALSO π
β HISTORY β
shtk_unittest_skip first appeared in shtk 1.6. our girl has been serving since day one. π§
and that's the whole page, bestie! shoutout to the Debian crew for shtk 1.6-era docs dated November 8, 2014 β genuinely a whole era ago, and she's still slaying the manual game. ππ
π¦ where this page comes from
- nixos 26.05: shtk 1.7
- nixpkgs unstable: shtk 1.7
- Copyright 2014 Google Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms