שגיאה בPYTEST-לא קיימת טבלה כזאת


מופיעה לי השגיאה הזאת. אני מממשת את האובייקטים שלי בקובץ calendar.py
ובבדיקה בDB BROWSER רואה שכן קיימת הטבלה שעשיתי(וכמובן שהפיצר מוצג באתר)
אפשר עזרה במציאת פתרון? די אובדת עצות

איך נראים הטסטים? הסתכלת באיך אחרים מימשו את הטסטים שלהם? :slight_smile:

לא אני יצרתי את הטסט,ולכן לא יודעת להצביע מה הבעיה.גם מי שכתב את הטסט הזה לא יודע להצביע

נסי להריץ את pytest עם vvv-, זה יתן Traceback של איפה זה קרס

הכוונה לבדיקה הזאת:
python -m pytest --cov-report term-missing --cov=app tests
???

הרי את מקבלת פלט של pytest שנכשל.
אז במקום להריץ pytest כרגיל, הריצי אותו עם -vvv


זה מחזיר לי את זה

תוכלי להעתיק ולהדביק לפה את כל הלוג בבקשה?

======================================================================================== FAILURES ========================================================================================
___________________________________________________________________________ TestCalendarGrid.test_get_calendar ___________________________________________________________________________

client = <starlette.testclient.TestClient object at 0x0000018ED660DA90>

@staticmethod
def test_get_calendar(client):
  response = client.get("/calendar/month")

tests\test_calendar_grid.py:24:


…\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py:555: in get
return self.request(‘GET’, url, **kwargs)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\testclient.py:413: in request
return super().request(
…\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py:542: in request
resp = self.send(prep, **send_kwargs)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py:677: in send
history = [resp for resp in gen]
…\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py:677: in
history = [resp for resp in gen]
…\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py:237: in resolve_redirects
resp = self.send(
…\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py:655: in send
r = adapter.send(request, **kwargs)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\testclient.py:243: in send
raise exc from None
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\testclient.py:240: in send
loop.run_until_complete(self.app(scope, receive, send))
…\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py:642: in run_until_complete
return future.result()
…\AppData\Local\Programs\Python\Python39\lib\site-packages\fastapi\applications.py:199: in call
await super().call(scope, receive, send)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\applications.py:111: in call
await self.middleware_stack(scope, receive, send)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\middleware\errors.py:181: in call
raise exc from None
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\middleware\errors.py:159: in call
await self.app(scope, receive, _send)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\exceptions.py:82: in call
raise exc from None
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\exceptions.py:71: in call
await self.app(scope, receive, sender)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py:566: in call
await route.handle(scope, receive, send)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py:227: in handle
await self.app(scope, receive, send)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py:41: in app
response = await func(request)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\fastapi\routing.py:201: in app
raw_response = await run_endpoint_function(
…\AppData\Local\Programs\Python\Python39\lib\site-packages\fastapi\routing.py:148: in run_endpoint_function
return await dependant.call(**values)
app\routers\calendar.py:24: in calendar
parasha_obj = weekly_parasha.get_all_parahot_list(session)
app\internal\weekly_parasha.py:23: in get_all_parahot_list
return session.query(Parasha).all()
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\orm\query.py:3373: in all
return list(self)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\orm\query.py:3535: in iter
return self._execute_and_instances(context)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\orm\query.py:3560: in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\engine\base.py:1011: in execute
return meth(self, multiparams, params)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\sql\elements.py:298: in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\engine\base.py:1124: in _execute_clauseelement
ret = self._execute_context(
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\engine\base.py:1316: in _execute_context
self.handle_dbapi_exception(
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\engine\base.py:1510: in handle_dbapi_exception
util.raise
(
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\util\compat.py:182: in raise

raise exception
…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\engine\base.py:1276: in _execute_context
self.dialect.do_execute(


self = <sqlalchemy.dialects.sqlite.pysqlite.SQLiteDialect_pysqlite object at 0x0000018ECCB11400>, cursor = <sqlite3.Cursor object at 0x0000018ED52841F0>
statement = ‘SELECT parashot.id AS parashot_id, parashot.name AS parashot_name, parashot.hebrew_name AS parashot_hebrew_name, parashot.link AS parashot_link, parashot.date AS parashot_dat
e \nFROM parashot’
parameters = (), context = <sqlalchemy.dialects.sqlite.base.SQLiteExecutionContext object at 0x0000018ED6A9F100>

def do_execute(self, cursor, statement, parameters, context=None):
  cursor.execute(statement, parameters)

E sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: parashot
E [SQL: SELECT parashot.id AS parashot_id, parashot.name AS parashot_name, parashot.hebrew_name AS parashot_hebrew_name, parashot.link AS parashot_link, parashot.date AS parashot_da
te
E FROM parashot]
E (Background on this error at: http://sqlalche.me/e/13/e3q8)

…\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\engine\default.py:609: OperationalError
==================================================================================== warnings summary ====================================================================================
tests/test_a_telegram_asyncio.py::TestBotClient::test_user_not_registered
tests/test_a_telegram_asyncio.py::TestBotClient::test_user_registered
tests/test_a_telegram_asyncio.py::TestHandlers::test_today_handler
tests/test_a_telegram_asyncio.py::TestHandlers::test_chosen_day_handler
tests/test_a_telegram_asyncio.py::TestHandlers::test_process_new_event
tests/test_about.py::test_about_page
C:\Users\אילור\AppData\Local\Programs\Python\Python39\lib\site-packages_pytest\unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <function _ProactorBas
ePipeTransport.del at 0x0000018E88B0C4C0>

Traceback (most recent call last):
File “C:\Users\אילור\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py”, line 116, in del
self.close()
File “C:\Users\אילור\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py”, line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File “C:\Users\אילור\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py”, line 746, in call_soon
self._check_closed()
File “C:\Users\אילור\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py”, line 510, in _check_closed
raise RuntimeError(‘Event loop is closed’)
RuntimeError: Event loop is closed

warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

tests/test_comment.py::test_delete_comment
tests/test_event.py::test_delete_comment
C:\Users\אילור\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\orm\persistence.py:1359: SAWarning: DELETE statement on table ‘comments’ expected to delete 1 row(s);
0 were matched. Please set confirm_deleted_rows=False within the mapper configuration to prevent this warning.
util.warn(

tests/test_export.py::TestExport::test_export
C:\Users\אילור\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\concurrency.py:16: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is d
eprecated since Python 3.8, and scheduled for removal in Python 3.11.
(done, pending) = await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)

tests/test_utils.py::TestUtils::test_delete_instance
C:\Users\אילור\AppData\Local\Programs\Python\Python39\lib\site-packages\sqlalchemy\orm\persistence.py:1359: SAWarning: DELETE statement on table ‘users’ expected to delete 1 row(s); 0 w
ere matched. Please set confirm_deleted_rows=False within the mapper configuration to prevent this warning.
util.warn(

– Docs: Warnings Capture — pytest documentation
================================================================================ short test summary info =================================================================================
FAILED tests/test_calendar_grid.py::TestCalendarGrid::test_get_calendar - sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: parashot

יש קישור ל־PR שאפשר להסתכל עליו?

בטח,

מצאת את הבעיה? @Yam :frowning: