Skip to content

Commit

Permalink
remove renaming fixtures and add example code
Browse files Browse the repository at this point in the history
  • Loading branch information
codingpaula committed Jul 29, 2024
1 parent 614a023 commit 278bb14
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions examples/pytests/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
from typing import AsyncGenerator, Generator

import pytest

from nicegui.testing import Screen, User


@pytest.fixture
def screen(nicegui_screen: Screen) -> Generator[Screen, None, None]:
yield nicegui_screen


@pytest.fixture
async def user(nicegui_user: User) -> AsyncGenerator[User, None]:
yield nicegui_user
'''
NOTE: This is uncommented because pytest doesn't allow for conftest.py files in subdirectories.
If you want to use this example as a template, you have to uncomment the next line
'''
# pytest_plugins = ['nicegui.testing.fixtures']

0 comments on commit 278bb14

Please sign in to comment.