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.
17 lines
582 B
Python
17 lines
582 B
Python
"""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)
|