-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Document testing framework #432
Comments
Honestly that would be amazing. We were discussing in another project how to improve our test suite. Right now we are tied to testing with a GitHub token and real GitHub objects. It would be much better if we could use mock objects and not call GitHub's API at all (or very little at least). We were just wondering how you are doing testing (as we use PyGithub heavily) and wondered if there were things we could learn from your approach. |
Should also add there are tons of PRs without tests. Maybe this is naive on my part, but I would think there would be many more PRs with tests if people understood how they worked. |
xref: #254 (comment) ? |
Still true today, took me a while to understand the testing framework |
Any thoughts on writing up something about what you learned about the testing framework? ;) |
@jakirkham Maybe in a bit, when I have some free time. |
@sfdye I recently wrote a library that also relies heavily on PyGithub. I took the time to learn the testing framework and extracted an isolated class that can be used to record and replay. I specifically use it inside py.test suites, not unittest. Is it possible for me to release such a class as a library on PyPI? I mean license wise. And if so, would you like to have a look? @jakirkham fyi |
@iliapolo I did not author the original test framework, but I guess that should be fine, since PyGithub is LGPL. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Just FYI, to whom is reading this, I've spent 4h trying to figure out how the testing framework works, but couldn't manage to crack it all... I decided to move on, and hacked a quick solution. This is probably not the best, but at least it does the job temporarily... |
@jayfk @sfdye since this documentation is pending since 2016 & many folks have requested it. Can you atleast point to how users can mock pygithub API tests? Framework.py file doesn't cut it... It'd be really helpful if we could get documentation or a working example of how to mock Github APIs in python. |
PyGithub comes with it's own testing framework that allows to record and replay requests.
Currently, there is no straightforward documentation for it.
The text was updated successfully, but these errors were encountered: