Skip to content

Can't use pytest to test components #3912

Closed Answered by falkoschindler
mariajmoreira asked this question in Q&A
Discussion options

You must be logged in to vote

The User fixture is built for tests like this, where you don't need any frontend functionality. Here's an example:

def test_large_label(user: User) -> None:
    label = ui.label('Hello').classes('text-2xl')
    assert 'text-2xl' in label.classes

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@mariajmoreira
Comment options

@falkoschindler
Comment options

@mariajmoreira
Comment options

@falkoschindler
Comment options

Answer selected by mariajmoreira
@mariajmoreira
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3911 on October 23, 2024 12:05.