Skip to content

Commit 71f4070

Browse files
committed
Switch to simple assert
1 parent d66e5f0 commit 71f4070

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

test/unit/nox/_artifacts_test.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ def test_passes_when_as_expected(self, tmp_path):
8585
text = "Your code has been rated at 7.85/10 (previous run: 7.83/10, +0.02"
8686
self._create_json_txt(path, text)
8787

88-
result = _is_valid_lint_txt(path)
89-
90-
assert result == True
88+
assert _is_valid_lint_txt(path)
9189

9290
def test_fails_when_rating_not_found(self, tmp_path, capsys):
9391
path = Path(tmp_path, LINT_TXT)
@@ -96,7 +94,7 @@ def test_fails_when_rating_not_found(self, tmp_path, capsys):
9694

9795
result = _is_valid_lint_txt(path)
9896

99-
assert result == False
97+
assert not result
10098
assert "Could not find a rating" in capsys.readouterr().out
10199

102100

@@ -113,7 +111,7 @@ def test_passes_when_as_expected(self, tmp_path):
113111
self._create_expected_json_file(path, attributes=LINT_JSON_ATTRIBUTES)
114112

115113
result = _is_valid_lint_json(path)
116-
assert result == True
114+
assert result
117115

118116
@staticmethod
119117
def test_is_not_a_json(tmp_path, capsys):
@@ -123,7 +121,7 @@ def test_is_not_a_json(tmp_path, capsys):
123121

124122
result = _is_valid_lint_json(path)
125123

126-
assert result == False
124+
assert not result
127125
assert "Invalid json file" in capsys.readouterr().out
128126

129127
@pytest.mark.parametrize(
@@ -136,7 +134,7 @@ def test_missing_attributes(self, tmp_path, capsys, missing_attributes):
136134

137135
result = _is_valid_lint_json(path)
138136

139-
assert result == False
137+
assert not result
140138
assert (
141139
f"missing the following attributes {missing_attributes}"
142140
in capsys.readouterr().out
@@ -155,8 +153,7 @@ def test_passes_when_as_expected(self, tmp_path):
155153
path = Path(tmp_path, SECURITY_JSON)
156154
self._create_expected_json_file(path, attributes=SECURITY_JSON_ATTRIBUTES)
157155

158-
result = _is_valid_security_json(path)
159-
assert result == True
156+
assert _is_valid_security_json(path)
160157

161158
@staticmethod
162159
def test_is_not_a_json(tmp_path, capsys):
@@ -166,7 +163,7 @@ def test_is_not_a_json(tmp_path, capsys):
166163

167164
result = _is_valid_security_json(path)
168165

169-
assert result == False
166+
assert not result
170167
assert "Invalid json file" in capsys.readouterr().out
171168

172169
@pytest.mark.parametrize(
@@ -179,7 +176,7 @@ def test_missing_attributes(self, tmp_path, capsys, missing_attributes):
179176

180177
result = _is_valid_security_json(path)
181178

182-
assert result == False
179+
assert not result
183180
assert (
184181
f"missing the following attributes {missing_attributes}"
185182
in capsys.readouterr().out

0 commit comments

Comments
 (0)