Skip to content

Commit

Permalink
[CI] fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
calendulish committed Jun 8, 2024
1 parent 3f03bfe commit 413f913
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
6 changes: 6 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,9 @@ async def wait_mail_code():
await asyncio.sleep(2)

return mail_code


pytestmark = pytest.mark.asyncio(scope="session")
loop = asyncio.new_event_loop()
login_task = loop.create_task(do_login())
loop.run_until_complete(login_task)
14 changes: 1 addition & 13 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,12 @@
from stlib import webapi, universe, community
from . import do_login, config, config_file, debug

debug("authenticating user", 0)
loop = asyncio.new_event_loop()
login_task = loop.create_task(do_login())
loop.run_until_complete(login_task)

pytestmark = pytest.mark.asyncio(scope="session")

def pytest_assertion_pass(item, lineno, orig, expl):
print(f"{item}:{lineno} -> {orig} resolves to {expl}")


@pytest_asyncio.fixture(scope='session')
def event_loop():
try:
yield loop
finally:
loop.close()


@pytest.fixture(scope='session')
def steamid() -> universe.SteamId:
return universe.generate_steamid(config.get('Test', 'steamid'))
Expand Down

0 comments on commit 413f913

Please sign in to comment.