chore: update development dependencies and improve test coverage
Some checks failed
CI / lint-and-test (push) Failing after 11s
Some checks failed
CI / lint-and-test (push) Failing after 11s
- Upgraded `pytest-asyncio` to version 1.0 to ensure compatibility with the latest features and improvements. - Increased the coverage threshold in pytest configuration to 80%, enhancing the quality assurance process. - Added a new `conftest.py` file to manage shared fixtures and improve test organization. - Introduced multiple new test files to cover various components, ensuring comprehensive test coverage across the application. - Updated the `.coverage` file to reflect the latest coverage metrics.
This commit is contained in:
16
tests/test_package_init.py
Normal file
16
tests/test_package_init.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""Tests for duty_teller package __init__ (version fallback)."""
|
||||
|
||||
import importlib
|
||||
from importlib.metadata import PackageNotFoundError
|
||||
from unittest.mock import patch
|
||||
|
||||
import duty_teller
|
||||
|
||||
|
||||
def test_version_fallback_when_package_not_installed():
|
||||
"""When version('duty-teller') raises PackageNotFoundError, __version__ is '0.1.0'."""
|
||||
with patch("importlib.metadata.version", side_effect=PackageNotFoundError):
|
||||
importlib.reload(duty_teller)
|
||||
assert duty_teller.__version__ == "0.1.0"
|
||||
# Restore so other tests see normal version
|
||||
importlib.reload(duty_teller)
|
||||
Reference in New Issue
Block a user