File tree 6 files changed +20
-0
lines changed
r/redundant-unittest-assert
6 files changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ def test ():
2
+ assert "There is an AssertionError" # [assert-on-string-literal]
Original file line number Diff line number Diff line change
1
+ def test ():
2
+ # Nothing, as an assert of a string literal will always pass
Original file line number Diff line number Diff line change
1
+ assert (1 , None ) # [assert-on-tuple]
Original file line number Diff line number Diff line change
1
+ x , y = (1 , None )
2
+ assert x
3
+ assert y
Original file line number Diff line number Diff line change
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 number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments