Skip to content

Commit e82b43e

Browse files
DanielNoordsprytnykPierre-Sassoulas
authored
Add documentation for messages with assert in their name (#5960)
Co-authored-by: Vladyslav Krylasov <[email protected]> Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent 4c82837 commit e82b43e

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test():
2+
assert "There is an AssertionError" # [assert-on-string-literal]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test():
2+
# Nothing, as an assert of a string literal will always pass
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
assert (1, None) # [assert-on-tuple]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
x, y = (1, None)
2+
assert x
3+
assert y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import unittest
2+
3+
4+
class DummyTestCase(unittest.TestCase):
5+
def test_dummy(self):
6+
self.assertTrue("foo") # [redundant-unittest-assert]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import unittest
2+
3+
4+
class DummyTestCase(unittest.TestCase):
5+
def test_dummy(self):
6+
# Nothing, as an assert of a string literal will always pass

0 commit comments

Comments
 (0)