From e90cdab06ddf8287ab00b2e5249713fc80b0b770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olof-Joachim=20Frahm=20=28=E6=AC=A7=E9=9B=85=E7=A6=8F=29?= Date: Fri, 9 Aug 2019 11:12:55 +0200 Subject: [PATCH] Fix PR review creation. (#1184) Do not modify the attributes of a PR when creating a review. --- github/PullRequest.py | 1 - tests/PullRequestReview.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/github/PullRequest.py b/github/PullRequest.py index 2dd4a9f0..685f0efb 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -449,7 +449,6 @@ class PullRequest(github.GithubObject.CompletableGithubObject): self.url + "/reviews", input=post_parameters ) - self._useAttributes(data) return github.PullRequestReview.PullRequestReview(self._requester, headers, data, completed=True) def create_review_request(self, reviewers=github.GithubObject.NotSet, team_reviewers=github.GithubObject.NotSet): diff --git a/tests/PullRequestReview.py b/tests/PullRequestReview.py index 397c9bd7..7e22138f 100644 --- a/tests/PullRequestReview.py +++ b/tests/PullRequestReview.py @@ -50,6 +50,9 @@ class PullRequestReview(Framework.TestCase): # Test ability to get a single review self.pullreview = self.pull.get_review(28482091) + def testDoesNotModifyPullRequest(self): + self.assertEqual(self.pull.id, 111649703) + def testDismiss(self): self.pullreview.dismiss("with prejudice") pr = self.pull.get_review(28482091)