mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-16 08:52:45 +00:00
- Track warned samples in global set to prevent log spam - Each sample only warned once per training session - Prevents thousands of duplicate warnings during training - Add tests to verify throttling behavior
Tests
Install
pip install pytest
Usage
pytest
Contribution
Pytest is configured to run tests in this directory. It might be a good idea to add tests closer in the code, as well as doctests.
Tests are functions starting with test_ and files with the pattern test_*.py.
def test_x():
assert 1 == 2, "Invalid test response"
Resources
pytest
- https://docs.pytest.org/en/stable/index.html
- https://docs.pytest.org/en/stable/how-to/assert.html
- https://docs.pytest.org/en/stable/how-to/doctest.html