ckp95
Re:Stop requiring only one assertion per unit test: Multiple assertion...
on Saturday November 05, 2022 @09:49AM (#33481455)
Does this do what you want?
https://github.com/ckp95/pytest-parametrize-cases
@parametrize_cases(
Case("handle null", age=None, x="foobar"),
Case("don't allow under 13s", age=11, x="foobar"),
Case("or old age pension", age=77, x="wobble"),
... # as many as you want
)
def test_lots_of_ways_to_fail(age, x):
with pytest.raises(ValueError):
function_under_test(age, x)
Re:Cron best practices
on Friday March 11, 2022 @09:23AM (#30640247)
What do you use instead?
Re:Some tiny personal programs I've written
on Wednesday March 09, 2022 @01:19PM (#30618080)
May as well flog the little zsh thing I wrote:
fwf -- "Filter With Feedback". It lets you write sed/awk/jq/grep etc things interactively. You type in a UNIX filter, and on every keystroke it renders the result in a column on the right, which you can compare to the original on the left (watch the video demonstration on the link if that description is confusing). I wrote it to make the feedback loop for text-processing as quick as possible. I use it all the time now. It makes the "activation energy" for writing shell pipelines a lot lower, if that makes sense.