Skip to content

Conversation

rodja
Copy link
Member

@rodja rodja commented Oct 15, 2025

Motivation

If an exception happens inside the fixture setup, the fixture was not reset correctly leading to failed tests.

Implementation

  • Updated screen and user fixtures to use try...finally for resource cleanup, ensuring environment variables are reset and servers are stopped even if an error occurs.
  • Improved error logging by checking for unexpected ERROR logs after yielding the fixture.
  • reactivate tests from test_main_file_marker.py (which failed before)

This change enhances the reliability of the testing framework by ensuring that resources are properly managed and that errors are logged appropriately.

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
  • Pytests have been reactivated.
  • Documentation is not necessary.

…ser)

- Updated `screen` and `user` fixtures to use `try...finally` for resource cleanup, ensuring environment variables are reset and servers are stopped even if an error occurs.
- Improved error logging by checking for unexpected ERROR logs after yielding the fixture.
- reactivate tests from `test_main_file_marker.py` (which failed before)

This change enhances the reliability of the testing framework by ensuring that resources are properly managed and that errors are logged appropriately.
@rodja rodja requested a review from falkoschindler October 15, 2025 15:53
@rodja rodja added the review Status: PR is open and needs review label Oct 15, 2025
@evnchn
Copy link
Collaborator

evnchn commented Oct 15, 2025

This is good. Should address the FEFEFEFEFEFE which occurs in the tests when the headless Chromium did not get shutdowned by the last tests which failed in an unclean manner (port occupied thereafter), which definitely did occur at least once among https://github.com/evnchn/nicegui/actions/workflows/test.yml but I can't quite find it.

@falkoschindler falkoschindler added the testing Type/scope: Pytests and test fixtures label Oct 15, 2025
@falkoschindler falkoschindler added this to the 3.1 milestone Oct 15, 2025
@falkoschindler falkoschindler merged commit 789e512 into main Oct 15, 2025
9 checks passed
@falkoschindler falkoschindler deleted the reset-fixtures branch October 15, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review Status: PR is open and needs review testing Type/scope: Pytests and test fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants