Skip to content

Commit

Permalink
chore: fix E741/E742 errors reported by flake8
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
JohnVillalovos committed Apr 18, 2021
1 parent af781c1 commit 380f227
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions gitlab/tests/mixins/test_mixin_methods.py
Expand Up @@ -44,7 +44,7 @@ def resp_cont(url, request):


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")
Expand All @@ -55,7 +55,7 @@ def resp_cont(url, request):

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"
Expand Down Expand Up @@ -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")
Expand All @@ -276,7 +276,7 @@ def resp_cont(url, request):

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"
Expand Down
24 changes: 12 additions & 12 deletions gitlab/tests/mixins/test_object_mixins_attributes.py
Expand Up @@ -27,35 +27,35 @@


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")
Expand All @@ -64,16 +64,16 @@ class O(TimeTrackingMixin):


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")
8 changes: 4 additions & 4 deletions gitlab/tests/test_gitlab.py
Expand Up @@ -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)
Expand Down

0 comments on commit 380f227

Please sign in to comment.