Closed ehmatthes closed 1 year ago
Love it. When I initially saw the test suite it did seem a bit redundant to have a separate method for each command, considering they are so similar.
If at some point we end up needing various git-dummy repo layouts to support the simulation of various git subcommands, we may need to find a way to parameterize the git-dummy options/flags as well, but that can put that on the backburner until that situation crops up.
Also (semi-unrelated) but I hear your points about keeping this first version of the test suite as simple as possible. But for the commands like add
, rm
, mv
, stash
etc the current test simulations don't fully reflect the functionality since no files exist to be added, removed, stashed, etc. Well actually they do exist for stuff like rm
and mv
since we can just execute those commands on existing dummy files, but for git-sim add
and stash
I am planning to update git-dummy to allow modifying a local file and/or creating a new untracked file which can be used for the test simulations.
Working on #99, I played around with parametrization. I didn't think it was going to help, but it is pretty compelling. Instead of 18 separate test functions, there's only one test function. All of the commands that are being tested are moved to one list,
git_sim_commands
:Then
test_command()
is called, with each of these passed as an argument calledraw_cmd
:Pros:
Cons:
$ pytest -k "test_log"
. That functionality can be built back in, I believe.When a test fails, you still get really clear information about what specific behavior is broken:
Overall, I think this is a change worth making. But that's entirely up to you, and I'd be quite happy to keep helping out with or without this change.