diff options
author | John L. Villalovos <john@sodarock.com> | 2021-04-17 14:01:45 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-04-18 07:04:40 -0700 |
commit | 380f227a1ecffd5e22ae7aefed95af3b5d830994 (patch) | |
tree | 7fb5914657c8acdefe5b91e85abd58228905c536 /gitlab/tests | |
parent | af781c10db3829163f977e494e4008acf2096d64 (diff) | |
download | gitlab-380f227a1ecffd5e22ae7aefed95af3b5d830994.tar.gz |
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)
Diffstat (limited to 'gitlab/tests')
-rw-r--r-- | gitlab/tests/mixins/test_mixin_methods.py | 8 | ||||
-rw-r--r-- | gitlab/tests/mixins/test_object_mixins_attributes.py | 24 | ||||
-rw-r--r-- | gitlab/tests/test_gitlab.py | 8 |
3 files changed, 20 insertions, 20 deletions
diff --git a/gitlab/tests/mixins/test_mixin_methods.py b/gitlab/tests/mixins/test_mixin_methods.py index 557c020..fbc16a9 100644 --- a/gitlab/tests/mixins/test_mixin_methods.py +++ b/gitlab/tests/mixins/test_mixin_methods.py @@ -44,7 +44,7 @@ def test_get_mixin(gl): def test_refresh_mixin(gl): - class O(RefreshMixin, FakeObject): + class TestClass(RefreshMixin, FakeObject): pass @urlmatch(scheme="http", netloc="localhost", path="/api/v4/tests/42", method="get") @@ -55,7 +55,7 @@ def test_refresh_mixin(gl): with HTTMock(resp_cont): mgr = FakeManager(gl) - obj = O(mgr, {"id": 42}) + obj = TestClass(mgr, {"id": 42}) res = obj.refresh() assert res is None assert obj.foo == "bar" @@ -265,7 +265,7 @@ def test_save_mixin(gl): class M(UpdateMixin, FakeManager): pass - class O(SaveMixin, base.RESTObject): + class TestClass(SaveMixin, base.RESTObject): pass @urlmatch(scheme="http", netloc="localhost", path="/api/v4/tests/42", method="put") @@ -276,7 +276,7 @@ def test_save_mixin(gl): with HTTMock(resp_cont): mgr = M(gl) - obj = O(mgr, {"id": 42, "foo": "bar"}) + obj = TestClass(mgr, {"id": 42, "foo": "bar"}) obj.foo = "baz" obj.save() assert obj._attrs["foo"] == "baz" diff --git a/gitlab/tests/mixins/test_object_mixins_attributes.py b/gitlab/tests/mixins/test_object_mixins_attributes.py index 3502a93..d54fa3a 100644 --- a/gitlab/tests/mixins/test_object_mixins_attributes.py +++ b/gitlab/tests/mixins/test_object_mixins_attributes.py @@ -27,35 +27,35 @@ from gitlab.mixins import ( def test_access_request_mixin(): - class O(AccessRequestMixin): + class TestClass(AccessRequestMixin): pass - obj = O() + obj = TestClass() assert hasattr(obj, "approve") def test_subscribable_mixin(): - class O(SubscribableMixin): + class TestClass(SubscribableMixin): pass - obj = O() + obj = TestClass() assert hasattr(obj, "subscribe") assert hasattr(obj, "unsubscribe") def test_todo_mixin(): - class O(TodoMixin): + class TestClass(TodoMixin): pass - obj = O() + obj = TestClass() assert hasattr(obj, "todo") def test_time_tracking_mixin(): - class O(TimeTrackingMixin): + class TestClass(TimeTrackingMixin): pass - obj = O() + obj = TestClass() assert hasattr(obj, "time_stats") assert hasattr(obj, "time_estimate") assert hasattr(obj, "reset_time_estimate") @@ -64,16 +64,16 @@ def test_time_tracking_mixin(): def test_set_mixin(): - class O(SetMixin): + class TestClass(SetMixin): pass - obj = O() + obj = TestClass() assert hasattr(obj, "set") def test_user_agent_detail_mixin(): - class O(UserAgentDetailMixin): + class TestClass(UserAgentDetailMixin): pass - obj = O() + obj = TestClass() assert hasattr(obj, "user_agent_detail") diff --git a/gitlab/tests/test_gitlab.py b/gitlab/tests/test_gitlab.py index 4a82207..127b2c1 100644 --- a/gitlab/tests/test_gitlab.py +++ b/gitlab/tests/test_gitlab.py @@ -86,10 +86,10 @@ def test_gitlab_build_list(gl): assert obj.total == 2 with HTTMock(resp_page_2): - l = list(obj) - assert len(l) == 2 - assert l[0]["a"] == "b" - assert l[1]["c"] == "d" + test_list = list(obj) + assert len(test_list) == 2 + assert test_list[0]["a"] == "b" + assert test_list[1]["c"] == "d" @with_httmock(resp_page_1, resp_page_2) |