Skip to content

Commit 380f227

Browse files
chore: fix E741/E742 errors reported by flake8
Fixes to resolve errors for: https://www.flake8rules.com/rules/E741.html Do not use variables named 'I', 'O', or 'l' (E741) https://www.flake8rules.com/rules/E742.html Do not define classes named 'I', 'O', or 'l' (E742)
1 parent af781c1 commit 380f227

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

gitlab/tests/mixins/test_mixin_methods.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def resp_cont(url, request):
4444

4545

4646
def test_refresh_mixin(gl):
47-
class O(RefreshMixin, FakeObject):
47+
class TestClass(RefreshMixin, FakeObject):
4848
pass
4949

5050
@urlmatch(scheme="http", netloc="localhost", path="/api/v4/tests/42", method="get")
@@ -55,7 +55,7 @@ def resp_cont(url, request):
5555

5656
with HTTMock(resp_cont):
5757
mgr = FakeManager(gl)
58-
obj = O(mgr, {"id": 42})
58+
obj = TestClass(mgr, {"id": 42})
5959
res = obj.refresh()
6060
assert res is None
6161
assert obj.foo == "bar"
@@ -265,7 +265,7 @@ def test_save_mixin(gl):
265265
class M(UpdateMixin, FakeManager):
266266
pass
267267

268-
class O(SaveMixin, base.RESTObject):
268+
class TestClass(SaveMixin, base.RESTObject):
269269
pass
270270

271271
@urlmatch(scheme="http", netloc="localhost", path="/api/v4/tests/42", method="put")
@@ -276,7 +276,7 @@ def resp_cont(url, request):
276276

277277
with HTTMock(resp_cont):
278278
mgr = M(gl)
279-
obj = O(mgr, {"id": 42, "foo": "bar"})
279+
obj = TestClass(mgr, {"id": 42, "foo": "bar"})
280280
obj.foo = "baz"
281281
obj.save()
282282
assert obj._attrs["foo"] == "baz"

gitlab/tests/mixins/test_object_mixins_attributes.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,35 @@
2727

2828

2929
def test_access_request_mixin():
30-
class O(AccessRequestMixin):
30+
class TestClass(AccessRequestMixin):
3131
pass
3232

33-
obj = O()
33+
obj = TestClass()
3434
assert hasattr(obj, "approve")
3535

3636

3737
def test_subscribable_mixin():
38-
class O(SubscribableMixin):
38+
class TestClass(SubscribableMixin):
3939
pass
4040

41-
obj = O()
41+
obj = TestClass()
4242
assert hasattr(obj, "subscribe")
4343
assert hasattr(obj, "unsubscribe")
4444

4545

4646
def test_todo_mixin():
47-
class O(TodoMixin):
47+
class TestClass(TodoMixin):
4848
pass
4949

50-
obj = O()
50+
obj = TestClass()
5151
assert hasattr(obj, "todo")
5252

5353

5454
def test_time_tracking_mixin():
55-
class O(TimeTrackingMixin):
55+
class TestClass(TimeTrackingMixin):
5656
pass
5757

58-
obj = O()
58+
obj = TestClass()
5959
assert hasattr(obj, "time_stats")
6060
assert hasattr(obj, "time_estimate")
6161
assert hasattr(obj, "reset_time_estimate")
@@ -64,16 +64,16 @@ class O(TimeTrackingMixin):
6464

6565

6666
def test_set_mixin():
67-
class O(SetMixin):
67+
class TestClass(SetMixin):
6868
pass
6969

70-
obj = O()
70+
obj = TestClass()
7171
assert hasattr(obj, "set")
7272

7373

7474
def test_user_agent_detail_mixin():
75-
class O(UserAgentDetailMixin):
75+
class TestClass(UserAgentDetailMixin):
7676
pass
7777

78-
obj = O()
78+
obj = TestClass()
7979
assert hasattr(obj, "user_agent_detail")

gitlab/tests/test_gitlab.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ def test_gitlab_build_list(gl):
8686
assert obj.total == 2
8787

8888
with HTTMock(resp_page_2):
89-
l = list(obj)
90-
assert len(l) == 2
91-
assert l[0]["a"] == "b"
92-
assert l[1]["c"] == "d"
89+
test_list = list(obj)
90+
assert len(test_list) == 2
91+
assert test_list[0]["a"] == "b"
92+
assert test_list[1]["c"] == "d"
9393

9494

9595
@with_httmock(resp_page_1, resp_page_2)

0 commit comments

Comments
 (0)