Add comprehensive test suite with 97% code coverage
Implemented full test coverage for core bot components: Test Coverage: - MentionDetector: 98% (28 tests) - mention detection, nickname handling, content extraction - Logger: 98% (15 tests) - file logging, log levels, unicode support - ConversationMemory: 91% (25 tests) - history management, time filtering, JSON persistence - PerplexityProvider: 100% (22 tests) - API calls, error handling, statistics - Config: 100% (26 tests) - env loading, validation, JSON config Infrastructure: - Added pytest, pytest-asyncio, pytest-mock, pytest-cov to requirements.txt - Created pytest.ini with coverage configuration - Created .coveragerc to exclude non-production files - Added conftest.py with shared fixtures and test isolation Test Features: - 116 total tests, all passing - Isolated test environment (clean env vars, logging handlers) - Async testing support for PerplexityProvider - Mocked HTTP requests to avoid real API calls - Comprehensive edge case coverage - Unicode/German character support testing Total: 97% code coverage across 273 statements
This commit is contained in:
parent
db467d774c
commit
f6813b5fa5
10 changed files with 1760 additions and 0 deletions
18
pytest.ini
Normal file
18
pytest.ini
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[pytest]
|
||||
testpaths = tests
|
||||
python_files = test_*.py
|
||||
python_classes = Test*
|
||||
python_functions = test_*
|
||||
addopts =
|
||||
-v
|
||||
--tb=short
|
||||
--strict-markers
|
||||
--cov=.
|
||||
--cov-report=term-missing
|
||||
--cov-report=html
|
||||
--cov-config=.coveragerc
|
||||
|
||||
markers =
|
||||
asyncio: mark test as async
|
||||
integration: mark test as integration test
|
||||
slow: mark test as slow running
|
||||
Loading…
Add table
Add a link
Reference in a new issue