mirror of
https://github.com/initialcommit-com/git-sim.git
synced 2026-04-26 19:15:51 +03:00
[PR #100] [MERGED] Use parametrization to simplify tests. #99
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/git-sim#99
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/initialcommit-com/git-sim/pull/100
Author: @ehmatthes
Created: 7/17/2023
Status: ✅ Merged
Merged: 7/17/2023
Merged by: @initialcommit-io
Base:
dev← Head:simplify_tests📝 Commits (5)
6db0a15Parametrization works for two simple commands.6c8e426All simple commands are parametrized.98c5f79Removed redundant tests.d9a1e7fAll complex commands are parametrized.650fffcAll commands are tested by one function.📊 Changes
1 file changed (+40 additions, -253 deletions)
View changed files
📝
tests/e2e_tests/test_core_commands.py(+40 -253)📄 Description
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.