Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit98de0f9

Browse files
committed
Fix the issue where the mock is persisting calls
1 parentbf944a4 commit98de0f9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎tests/unit/helper.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
importgithub3
33
importunittest
44

5-
MockedSession=mock.create_autospec(github3.session.GitHubSession)
6-
75

86
defbuild_url(self,*args,**kwargs):
97
# We want to assert what is happening with the actual calls to the
@@ -17,8 +15,12 @@ class UnitHelper(unittest.TestCase):
1715
# Sub-classes must also assign a dictionary to this during definition
1816
example_data= {}
1917

18+
defcreate_mocked_session(self):
19+
MockedSession=mock.create_autospec(github3.session.GitHubSession)
20+
returnMockedSession()
21+
2022
defcreate_session_mock(self,*args):
21-
session=MockedSession()
23+
session=self.create_mocked_session()
2224
base_attrs= ['headers','auth']
2325
attrs=dict(
2426
(key,mock.Mock())forkeyinset(args).union(base_attrs)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp