pytest-hot-reloading

0.1.0a19 · active · verified Fri Apr 17

pytest-hot-reloading is a pytest plugin that enables hot-reloading of tests during development. It watches for changes in your project files and automatically re-runs affected tests, providing immediate feedback without restarting the pytest session. It is currently in an alpha stage, meaning its API and behavior may change. Releases are irregular due to its early development phase.

Common errors

Warnings

Install

Quickstart

Install the plugin and simply run pytest as you normally would. The plugin automatically detects changes in your project files and re-runs relevant tests without requiring you to manually restart the pytest command.

# 1. Install the plugin
# pip install pytest-hot-reloading

# 2. Create a test file (e.g., test_example.py)
# with the content:
# def test_initial_check():
#     assert True

# 3. Run pytest normally from your terminal
# pytest

# 4. While pytest is running, modify test_example.py
# For instance, change 'assert True' to 'assert False' and save.
# The tests should automatically re-run and show the new result.
# Change it back to 'assert True' and save to see it pass again.

view raw JSON →