Skip to content

Commit 630901b

Browse files
chore: fix E711 error reported by flake8
E711: Comparison to none should be 'if cond is none:' https://www.flake8rules.com/rules/E711.html
1 parent 83670a4 commit 630901b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

gitlab/tests/test_base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_instantiate(self, fake_gitlab, fake_manager):
8080

8181
assert {"foo": "bar"} == obj._attrs
8282
assert {} == obj._updated_attrs
83-
assert None == obj._create_managers()
83+
assert obj._create_managers() is None
8484
assert fake_manager == obj.manager
8585
assert fake_gitlab == obj.manager.gitlab
8686

@@ -112,7 +112,7 @@ def test_get_id(self, fake_manager):
112112
assert 42 == obj.get_id()
113113

114114
obj.id = None
115-
assert None == obj.get_id()
115+
assert obj.get_id() is None
116116

117117
def test_custom_id_attr(self, fake_manager):
118118
class OtherFakeObject(FakeObject):

gitlab/tests/test_config.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_valid_data(m_open, path_exists):
154154
assert "one" == cp.gitlab_id
155155
assert "http://one.url" == cp.url
156156
assert "ABCDEF" == cp.private_token
157-
assert None == cp.oauth_token
157+
assert cp.oauth_token is None
158158
assert 2 == cp.timeout
159159
assert cp.ssl_verify is True
160160
assert cp.per_page is None
@@ -166,7 +166,7 @@ def test_valid_data(m_open, path_exists):
166166
assert "two" == cp.gitlab_id
167167
assert "https://two.url" == cp.url
168168
assert "GHIJKL" == cp.private_token
169-
assert None == cp.oauth_token
169+
assert cp.oauth_token is None
170170
assert 10 == cp.timeout
171171
assert cp.ssl_verify is False
172172

@@ -177,7 +177,7 @@ def test_valid_data(m_open, path_exists):
177177
assert "three" == cp.gitlab_id
178178
assert "https://three.url" == cp.url
179179
assert "MNOPQR" == cp.private_token
180-
assert None == cp.oauth_token
180+
assert cp.oauth_token is None
181181
assert 2 == cp.timeout
182182
assert "/path/to/CA/bundle.crt" == cp.ssl_verify
183183
assert 50 == cp.per_page
@@ -188,7 +188,7 @@ def test_valid_data(m_open, path_exists):
188188
cp = config.GitlabConfigParser(gitlab_id="four")
189189
assert "four" == cp.gitlab_id
190190
assert "https://four.url" == cp.url
191-
assert None == cp.private_token
191+
assert cp.private_token is None
192192
assert "STUV" == cp.oauth_token
193193
assert 2 == cp.timeout
194194
assert cp.ssl_verify is True
@@ -227,7 +227,7 @@ def test_data_from_helper(m_open, path_exists, tmp_path):
227227
cp = config.GitlabConfigParser(gitlab_id="helper")
228228
assert "helper" == cp.gitlab_id
229229
assert "https://helper.url" == cp.url
230-
assert None == cp.private_token
230+
assert cp.private_token is None
231231
assert "secret" == cp.oauth_token
232232

233233

0 commit comments

Comments
 (0)