1. Michał Bartoszkiewicz
  2. pytest

Commits

Michał Bartoszkiewicz  committed babc469

Fix a typo in assertion rewriting.

  • Participants
  • Parent commits 93b1931
  • Branches default

Comments (0)

Files changed (2)

File _pytest/assertion/rewrite.py

View file
  • Ignore whitespace
             if chain:
                 where = []
                 if len(chain) > 1:
-                    cond = ast.Boolop(ast.And(), chain)
+                    cond = ast.BoolOp(ast.And(), list(chain))
                 else:
                     cond = chain[0]
                 self.statements.append(ast.If(cond, where, []))

File testing/test_assertrewrite.py

View file
  • Ignore whitespace
             assert f or g
         getmsg(f, must_pass=True)
 
+    def test_long_chain(self):
+        def f():
+            f = g = h = lambda: True
+            assert f() and g() and h()
+        getmsg(f, must_pass=True)
+
     def test_short_circut_evaluation(self):
         def f():
             assert True or explode