8000 Fixed PEP/E731 for several tests · pythonthings/github3.py@f2d05d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit f2d05d4

Browse files
Fixed PEP/E731 for several tests
1 parent 18014e0 commit f2d05d4

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

tests/integration/test_session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
class TestGitHubSession(IntegrationHelper):
77
def test_two_factor_authentication_works(self):
8-
two_factor_auth = lambda: '862478'
8+
def _two_factor_auth():
9+
return '862478'
10+
two_factor_auth = _two_factor_auth
911
self.basic_login()
1012
self.gh.login(two_factor_callback=two_factor_auth)
1113

tests/unit/test_github.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,11 @@ def test_login(self):
288288
def test_login_with_token(self):
289289
"""Verify the request for user logging in."""
290290
token = 'OauthToken'
291-
callback = lambda x: x
291+
292+
def _callback(x):
293+
return x
294+
295+
callback = _callback
292296
self.instance.login(token=token, two_factor_callback=callback)
293297
self.session.token_auth.assert_called_once_with(token)
294298
self.session.two_factor_auth_callback.assert_called_once_with(

tests/unit/test_github_session.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ def test_two_factor_auth_callback_accepts_a_Callable(self):
172172
s = self.build_session()
173173
assert s.two_factor_auth_cb is None
174174
# You have to have a sense of humor ;)
175-
not_so_anonymous = lambda *args: 'foo'
175+
176+
def _not_so_anonymous(*args):
177+
return 'foo'
178+
179+
not_so_anonymous = _not_so_anonymous
176180
s.two_factor_auth_callback(not_so_anonymous)
177181
assert s.two_factor_auth_cb is not_so_anonymous
178182

tests/unit/test_structs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ def after_setup(self):
1111

1212
def create_instance_of_described_class(self):
1313
self.url = 'https://api.github.com/users'
14-
klass = lambda *args: args
14+
15+
def _klass(*args):
16+
return args
17+
18+
klass = _klass
1519
instance = self.described_class(count=-1, url=self.url, cls=klass,
1620
session=self.session)
1721
return instance

0 commit comments

Comments
 (0)
0