whythawk / full-stack-fastapi-postgresql

Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Nuxt3, Docker, automatic HTTPS and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No schema for ItemCreate

lukasz-madon opened this issue · comments

commented

There is an import in tests but no definition in code.

git:(main) ✗ docker-compose exec backend bash
root@eedc12fd4540:/app# ls
alembic  alembic.ini  app  imports  inboard  mypy.ini  poetry.lock  poetry.toml  prestart.sh  pyproject.toml  scripts  tests-start.sh  worker-start.sh
root@eedc12fd4540:/app# py.test
=========================================================================================== test session starts ============================================================================================
platform linux -- Python 3.9.15, pytest-7.2.1, pluggy-1.0.0
rootdir: /app
plugins: anyio-3.6.2, cov-4.0.0
collected 19 items / 2 errors

================================================================================================== ERRORS ==================================================================================================
___________________________________________________________________________ ERROR collecting app/tests/api/api_v1/test_items.py ____________________________________________________________________________
ImportError while importing test module '/app/app/tests/api/api_v1/test_items.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
app/tests/api/api_v1/test_items.py:5: in <module>
    from app.tests.utils.item import create_random_item
app/tests/utils/item.py:6: in <module>
    from app.schemas.item import ItemCreate
E   ModuleNotFoundError: No module named 'app.schemas.item'
_______________________________________________________________________________ ERROR collecting app/tests/crud/test_item.py _______________________________________________________________________________
ImportError while importing test module '/app/app/tests/crud/test_item.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
app/tests/crud/test_item.py:4: in <module>
    from app.schemas.item import ItemCreate, ItemUpdate
E   ModuleNotFoundError: No module named 'app.schemas.item'
============================================================================================= warnings summary =============================================================================================
.venv/lib/python3.9/site-packages/pkg_resources/__init__.py:121
  /app/.venv/lib/python3.9/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================================= short test summary info ==========================================================================================
ERROR app/tests/api/api_v1/test_items.py
ERROR app/tests/crud/test_item.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================================= 1 warning, 2 errors in 1.93s =======================================================================================
root@eedc12fd4540:/app#

Hey @lukasz-madon I haven't updated all the tests and was kinda hoping someone else might like to take on that responsibility :|

If you're keen, I'm happy to review a tests pull request and integrate it into the project.