[PR #195] test: add comprehensive pytest unit test suite #213

Open
opened 2026-05-07 00:19:14 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/195
Author: @egi03
Created: 1/25/2026
Status: 🔄 Open

Base: mainHead: add-unit-tests


📝 Commits (2)

  • 67dfd41 test: add comprehensive pytest unit test suite
  • 3abfdd3 fix: address code review feedback

📊 Changes

7 files changed (+827 additions, -1 deletions)

View changed files

pytest.ini (+9 -0)
📝 requirements.txt (+5 -1)
tests/__init__.py (+1 -0)
tests/conftest.py (+169 -0)
tests/test_time.py (+262 -0)
tests/test_tyres.py (+193 -0)
tests/test_ui_helpers.py (+188 -0)

📄 Description

Summary

This PR adds a comprehensive pytest unit test suite to establish testing infrastructure for the project.

Changes

  • pytest.ini - Test configuration with discovery patterns
  • tests/conftest.py - Shared fixtures for time strings, tyre compounds, and wind directions
  • tests/test_time.py - ~50 parametrized tests for format_time() and parse_time_string()
  • tests/test_tyres.py - ~40 parametrized tests for tyre compound conversions
  • tests/test_ui_helpers.py - ~40 parametrized tests for _format_wind_direction()
  • requirements.txt - Added pytest and pytest-cov dependencies

Total: 100+ test cases

How to Run

python -m pytest tests/ -v                     # Run all tests
python -m pytest tests/ --cov=src/lib          # With coverage

---

<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/195 **Author:** [@egi03](https://github.com/egi03) **Created:** 1/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `add-unit-tests` --- ### 📝 Commits (2) - [`67dfd41`](https://github.com/IAmTomShaw/f1-race-replay/commit/67dfd41324ece08cf1cfdda7d494090ac6859d60) test: add comprehensive pytest unit test suite - [`3abfdd3`](https://github.com/IAmTomShaw/f1-race-replay/commit/3abfdd3d9ce357086070e95cd0d250b0901dddde) fix: address code review feedback ### 📊 Changes **7 files changed** (+827 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `pytest.ini` (+9 -0) 📝 `requirements.txt` (+5 -1) ➕ `tests/__init__.py` (+1 -0) ➕ `tests/conftest.py` (+169 -0) ➕ `tests/test_time.py` (+262 -0) ➕ `tests/test_tyres.py` (+193 -0) ➕ `tests/test_ui_helpers.py` (+188 -0) </details> ### 📄 Description ## Summary This PR adds a comprehensive pytest unit test suite to establish testing infrastructure for the project. ## Changes - **pytest.ini** - Test configuration with discovery patterns - **tests/conftest.py** - Shared fixtures for time strings, tyre compounds, and wind directions - **tests/test_time.py** - ~50 parametrized tests for [format_time()](cci:1://file:///c:/Users/Egi/Desktop/f1-race-replay/src/lib/time.py:5:0-10:37) and [parse_time_string()](cci:1://file:///c:/Users/Egi/Desktop/f1-race-replay/src/lib/time.py:12:0-69:15) - **tests/test_tyres.py** - ~40 parametrized tests for tyre compound conversions - **tests/test_ui_helpers.py** - ~40 parametrized tests for [_format_wind_direction()](cci:1://file:///c:/Users/Egi/Desktop/f1-race-replay/src/interfaces/race_replay.py:302:4-311:24) - **requirements.txt** - Added pytest and pytest-cov dependencies ## Total: 100+ test cases ## How to Run ```bash python -m pytest tests/ -v # Run all tests python -m pytest tests/ --cov=src/lib # With coverage --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#213
No description provided.