File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from mellea .stdlib .chat import Message
1010from mellea .stdlib .session import start_session , MelleaSession
1111
12+ import time
13+
1214
1315# We edit the context type in the async tests below. Don't change the scope here.
1416@pytest .fixture (scope = "function" )
@@ -138,20 +140,25 @@ class TestPowerup:
138140 def hello (m : MelleaSession ):
139141 return "hello"
140142
141- class TestPowerupInherit ( TestPowerup ):
142- def hello2 ( m : MelleaSession ):
143+ async def ahello ( m : MelleaSession ):
144+ time . sleep ( 3 )
143145 return "hello"
144146
145147
146- def test_powerup (m_session ):
148+ class TestPowerupInherit (TestPowerup ):
149+ def hello2 (m : MelleaSession ):
150+ return "hello"
151+
147152
153+ async def test_powerup (m_session ):
148154 MelleaSession .powerup (TestPowerup )
149155
150156 assert "hello" == m_session .hello ()
157+ assert "hello" == await m_session .ahello ()
151158
152159 MelleaSession .powerup (TestPowerupInherit )
153160
154- assert "hello" == m_session .hello () # check the inheritance is respected
161+ assert "hello" == m_session .hello () # check the inheritance is respected
155162 assert "hello" == m_session .hello2 ()
156163
157164
You can’t perform that action at this time.
0 commit comments