HackerTrans
トップ新着トレンドコメント過去質問紹介求人

ckp95

no profile record

コメント

ckp95
·4 年前·議論
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)
ckp95
·4 年前·議論
May as well flog the little zsh thing I wrote:

https://github.com/ckp95/fwf/

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.