Browse Source

fixed assertion

Rodja Trappe 2 years ago
parent
commit
d8e30262c1
1 changed files with 5 additions and 5 deletions
  1. 5 5
      tests/test_auto_context.py

+ 5 - 5
tests/test_auto_context.py

@@ -38,8 +38,8 @@ def test_adding_elements_with_async_await(screen: Screen):
         ui.timer(1.1, add_b, once=True)
 
     screen.open('/')
-    for i in range(40):
-        if not '''card\n  A\ncard\n  B''' in screen.render_content():
-            screen.wait(0.1)
-        else:
-            raise AssertionError(f'{screen.render_content()} should show cards with "A" and "B"')
+    for i in range(20):
+        if 'card\n  A\ncard\n  B' in screen.render_content():
+            return
+        screen.wait(0.1)
+    raise AssertionError(f'{screen.render_content()} should show cards with "A" and "B"')