Browse Source

#338 try fixing tests with slightly different timing

Falko Schindler 2 years ago
parent
commit
060f79d744
2 changed files with 4 additions and 2 deletions
  1. 2 2
      tests/test_auto_context.py
  2. 2 0
      tests/test_table.py

+ 2 - 2
tests/test_auto_context.py

@@ -110,13 +110,13 @@ def test_adding_elements_from_different_tasks(screen: Screen):
 
     async def add_label1() -> None:
         with card1:
-            await asyncio.sleep(1.0)
+            await asyncio.sleep(0.5)
             ui.label('1')
 
     async def add_label2() -> None:
         with card2:
             ui.label('2')
-            await asyncio.sleep(1.0)
+            await asyncio.sleep(0.5)
 
     screen.open('/')
     background_tasks.create(add_label1())

+ 2 - 0
tests/test_table.py

@@ -30,10 +30,12 @@ def test_add_row(screen: Screen):
     screen.open('/')
     table.options['rowData'].append({'name': 'Alice', 'age': 18})
     screen.click('Update')
+    screen.wait(0.5)
     screen.should_contain('Alice')
     screen.should_contain('18')
     table.options['rowData'].append({'name': 'Bob', 'age': 21})
     screen.click('Update')
+    screen.wait(0.5)
     screen.should_contain('Alice')
     screen.should_contain('18')
     screen.should_contain('Bob')