Skip to content

Added new modules, Improved code organization and Testing infrastructure#1

Open
akramIOT wants to merge 1 commit intovineethsai:mainfrom
akramIOT:akram_review_ANS
Open

Added new modules, Improved code organization and Testing infrastructure#1
akramIOT wants to merge 1 commit intovineethsai:mainfrom
akramIOT:akram_review_ANS

Conversation

@akramIOT
Copy link

@akramIOT akramIOT commented May 9, 2025

- Added new modules, Improved code organization and Testing infrastructure                           
  • Added unit tests in tests/ folder for configuration, database, and logging
  • Reconfigured logging system to store logs in tests/logs/ directory
  • Added tests/README.md with documentation on the test suite
  • Added .gitignore file to exclude temporary and generated files
  • Fixed test failures due to mocking issues with logging

UNIT TESTING LOGS::

TDD Passing Logs also dumped into the folder under /tests/logs/*.log

(cd /Users/akram_personal/AKRAM_CODE_FOLDER/ANS && source testvenv/bin/activate && PYTHONPATH=/Users/akram_personal/AKRAM_CODE_FOLDER/ANS python -m …
pytest -xvs tests/test_config.py)
⎿  ============================= test session starts ==============================
platform darwin -- Python 3.12.9, pytest-8.3.5, pluggy-1.5.0 -- /Users/akram_personal/AKRAM_CODE_FOLDER/ANS/testvenv/bin/python
cachedir: .pytest_cache
rootdir: /Users/akram_personal/AKRAM_CODE_FOLDER/ANS
plugins: anyio-4.9.0, asyncio-0.26.0

 … +11 lines (ctrl+r to expand)

   /Users/akram_personal/AKRAM_CODE_FOLDER/ANS/ans/db/models.py:10: MovedIn20Warning: The ``declarative_base()`` function is now available as
 sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
     Base = declarative_base()

 -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

 ========================= 5 passed, 1 warning in 0.38s =========================

⎿ /Users/akram_personal/AKRAM_CODE_FOLDER/ANS/testvenv/lib/python3.12/site-packages/pytest_asyncio/plugin.py:217: PytestDeprecationWarning: The
configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope
for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid
fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
  1. tests/test_config.py - Tests for configuration and environment validation
  2. tests/test_database.py - Tests for database functionality
  3. tests/test_logging.py - Tests for logging functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant