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
1213
1314# We edit the context type in the async tests below. Don't change the scope here.
1415@pytest .fixture (scope = "function" )
@@ -138,18 +139,29 @@ class TestPowerup:
138139 def hello (m :MelleaSession ):
139140 return "hello"
140141
142+ async def ahello (m :MelleaSession ):
143+ time .sleep (3 )
144+ return "hello"
145+
146+
141147class TestPowerupInherit (TestPowerup ):
142148 def hello2 (m :MelleaSession ):
143149 return "hello"
144150
145151
146- def test_powerup (m_session ):
152+ async def test_powerup (m_session ):
153+
154+ MelleaSession .powerup (TestPowerup )
155+
156+ assert "hello" == m_session .hello ()
157+ assert "hello" == await m_session .ahello ()
147158
148159 MelleaSession .powerup (TestPowerupInherit )
149160
150161 assert "hello" == m_session .hello () # check the inheritance is respected
151162 assert "hello" == m_session .hello2 ()
152163
153164
165+
154166if __name__ == "__main__" :
155167 pytest .main ([__file__ ])
You can’t perform that action at this time.
0 commit comments