-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: test utils and simplify the case code #1136
Conversation
* test_git_browse_ci.py * test_git_browse.py
5a19d4d
to
8a3b8bd
Compare
3. Create a test case `test_init`, and some test fixtures can be used, `temp_repo`, `named_temp_repo` etc. | ||
* `temp_repo` is module scoped fixture which create a temporary directory and available in the test suite `test_git_alias.py`. | ||
* `named_temp_repo` is just same as `temp_repo` except the custom directory renaming. | ||
4. Loop the third step until the 100% coverage of the function of the `git-alias` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4. Loop the third step until the 100% coverage of the function of the `git-alias` | |
4. Loop the third step until the 100% coverage of the function of the `git-alias` |
Could we have a way to measure it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the coverage of the unit test is a good way to measure it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pytest coverage will be update in another PR.
tests/README.md
Outdated
|
||
For example, | ||
|
||
1. The `git-alias` should has a test suite, so create `test_git_alias.py` in the directory `test` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. The `git-alias` should has a test suite, so create `test_git_alias.py` in the directory `test` | |
1. The `git-alias` should have a test suite, so create `test_git_alias.py` in the directory `test` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rename https://github.com/tj/git-extras/blob/main/tests/test_authors.py?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be, update later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update
tests/helper.py
Outdated
try: | ||
self._git_repo.git.remote("add", "origin", origin_url) | ||
except GitCommandError: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should log the error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log is better but the throw is not expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update
No description provided.