When IncompletableObject was added, it was only added to
GithubException, and not imported directly into the github namespace
like other exceptions. Correct that, and clean up the resultant now
unrequired import.
To integrate better with the GitHub workflow, add a workflow for
checking pushes and PRs. This doesn't remove the Travis configuration,
which is still required for releases.
Co-Authored-By: Christian Clauss <cclauss@me.com>
Deployment, TimelineEvent{,Source} were missing mypy stubs, since they
were added after the mypy branch was started. Add them, and clean up two
spurious __future__ imports that are no longer required. Add mypy's
cache directory to .gitignore
The testStatistics testcase takes over ten seconds to run on my laptop,
and it does an awful lot of work. Split up the disparate parts into
seperate testcases.
* Use pytest to parametrize tests
Use built-in pytest test case parametrization support over external
'parameterize' package. The latter is not well maintained, and has
known Python 3.8 failures unsolved since November 2019.
Since pytest fixtures are incompatible with unittest-style tests,
rewrite the relevant test case to use pytest-style asserts. This also
makes the resulting code simpler, as we no longer have to pass TestCase
to the helper classes.
* Refactor input cleaning in ReplayingConnection.__readNextRequest()
* Add "get_repo_permission" to Team class
* second attempt:
- accept repo name or repo object
- return github.Permissions.Permissions object
- try and following CONTRIBUTING.md better
* add missing import to tests
patch replay data with permission data
* assert a specific permission rather than just the type
Fixes#1415
The two methods PullRequest.add_to_assignees() and
PullRequest.remove_from_assignees() are special, in that they call
POST/DELETE on the issue_url of the pull request, and then transform all
their attributes based on what was returned. This has a number of
effects, none of them any good for calling new methods on the same pull
request object. Instead, only pull out the changed attribute and use
that. Also change the returned URL for the POST call in the replay data
to match what GitHub returns.
Fixes#1406
The function create_git_tag_and_release had no docstring, so it didn't
appear anywhere in our docs. Add a short one linking to the two methods
it calls.
Fixes#1402
Add a new class, Deployment to describe a deployment performed utilising
GitHub. Add three methods onto Repository to list them and create them.
Fixes#1117
Due to the recent deprecation of setup.py test, we should move with the
times, and switch to a non-deprecated test runner.
Add configuration for pytest, and switch tox to using it. Remove
AllTests, since it is no longer required to locate test classes, and
rewrite tests/__main__.py as a pytest conftest plugin.
Also drop the test function from manage.sh, tox does a much better job.
While investigating pytest, I discovered this test class was not
imported in AllTests, so it never ran, and worse, it would always fail
because it would get a NamedUser, and not an AuthenticatedUser. Add it
in it, and hit it with a hammer until it passes.
* PullRequest.update_branch(): allow expected_head_sha to be empty
* PullRequest.testUpdateBranch(): test also with empty expected_head_sha
* Updated replay data for PullRequest.testUpdateBranch
* tox formatted changes
A few test classes were failing to call tearDown() of the superclass,
which meant the file descriptors of their replydata files were leaking.
Make sure to call it, and switch every other callsite of superclasses by
name to using argument-less super().
Revert an AllTests change that snuck in during release.