stustapay / stustapay

Electronic Payment System for Events using NFC Wristbands

Home Page:https://stustapay.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytest

AlessandroW opened this issue · comments

any reason we don't use pytest? makes a much cleaner experience using fixtures.

Example

@pytest.fixture(scope="session")
async def token(user_service):
    user_login_result = await user_service.login_user(username="admin", password="rolf")
    return user_login_result.token

Instead of

 self.admin_token = (await self.user_service.login_user(username=self.admin_user.login, password="rolf")).token

Good point, haven't used pytest that much myself but the example looks a lot better than what we have now.

If you've got time to do a merge request that would be great!

Since that was a very good point #272 included a test system rewrite to use the pytest fixtures.