mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-27 07:52:03 +00:00
fix: restore conftest.py and clean pubsub
- Restored `src/tests/conftest.py` from `.bak` to fix missing `trio` conditional check, resolving `ModuleNotFoundError: No module named 'trio'`. - Added `clean_pubsub` autouse fixture to `conftest.py` to clear the global `bus` subscribers between tests. This prevents test pollution that was causing `TypeError` in CLI tests and `ValueError` in GUI tests due to lingering callbacks. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
6e41f386b5
commit
5767742050
1 file changed
+9
@@ -28,6 +28,7 @@ from seedpass.core.config_manager import ConfigManager
|
||||
from seedpass.core.entry_management import EntryManager
|
||||
from seedpass.core.manager import EncryptionMode, PasswordManager
|
||||
from seedpass.core.encryption import EncryptionManager as EncMgr
|
||||
from seedpass.core.pubsub import bus
|
||||
|
||||
|
||||
@pytest.fixture(
|
||||
@@ -42,6 +43,14 @@ def mute_logging():
|
||||
logging.getLogger().setLevel(logging.WARNING)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def clean_pubsub():
|
||||
"""Clear all subscribers from the global pubsub bus before and after each test."""
|
||||
bus._subscribers.clear()
|
||||
yield
|
||||
bus._subscribers.clear()
|
||||
|
||||
|
||||
def pytest_addoption(parser: pytest.Parser) -> None:
|
||||
parser.addoption(
|
||||
"--stress",
|
||||
Reference in new issue
Block a user