Procházet zdrojové kódy

#338 try fixing tests with slightly different timing

Falko Schindler před 2 roky
rodič
revize
060f79d744
2 změnil soubory, kde provedl 4 přidání a 2 odebrání
  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:
     async def add_label1() -> None:
         with card1:
         with card1:
-            await asyncio.sleep(1.0)
+            await asyncio.sleep(0.5)
             ui.label('1')
             ui.label('1')
 
 
     async def add_label2() -> None:
     async def add_label2() -> None:
         with card2:
         with card2:
             ui.label('2')
             ui.label('2')
-            await asyncio.sleep(1.0)
+            await asyncio.sleep(0.5)
 
 
     screen.open('/')
     screen.open('/')
     background_tasks.create(add_label1())
     background_tasks.create(add_label1())

+ 2 - 0
tests/test_table.py

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