Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- python -m pytest
- ===================================================================================================== test session starts ======================================================================================================
- platform win32 -- Python 3.9.12, pytest-7.1.2, pluggy-1.0.0
- rootdir: C:\Users\nmyle\OneDrive\Desktop\flaskcode\flaskblog2
- plugins: anyio-3.5.0
- collected 8 items
- app\tests\test_testingpytest.py ... [ 37%]
- app\tests\functional\test_routes.py EEEE [ 87%]
- app\tests\unit\test_models.py . [100%]
- ============================================================================================================ ERRORS ============================================================================================================
- ___________________________________________________________________________________________ ERROR at setup of test_register_page_get ___________________________________________________________________________________________
- new_user = <User 'fkpr[kfkuh'>
- @pytest.fixture()
- def init_database(new_user):
- # Create the database and the database table
- > db.create_all()
- app\tests\conftest.py:124:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1094: in create_all
- self._execute_for_all_tables(app, bind, 'create_all')
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1071: in _execute_for_all_tables
- app = self.get_app(app)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <SQLAlchemy engine=None>, reference_app = None
- def get_app(self, reference_app=None):
- """Helper method that implements the logic to look up an
- application."""
- if reference_app is not None:
- return reference_app
- if current_app:
- return current_app._get_current_object()
- if self.app is not None:
- return self.app
- > raise RuntimeError(
- 'No application found. Either work inside a view function or push'
- ' an application context. See'
- ' http://flask-sqlalchemy.pocoo.org/contexts/.'
- )
- E RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1042: RuntimeError
- __________________________________________________________________________________________ ERROR at setup of test_register_page_post ___________________________________________________________________________________________
- new_user = <User 'fkpr[kfkuh'>
- @pytest.fixture()
- def init_database(new_user):
- # Create the database and the database table
- > db.create_all()
- app\tests\conftest.py:124:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1094: in create_all
- self._execute_for_all_tables(app, bind, 'create_all')
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1071: in _execute_for_all_tables
- app = self.get_app(app)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <SQLAlchemy engine=None>, reference_app = None
- def get_app(self, reference_app=None):
- """Helper method that implements the logic to look up an
- application."""
- if reference_app is not None:
- return reference_app
- if current_app:
- return current_app._get_current_object()
- if self.app is not None:
- return self.app
- > raise RuntimeError(
- 'No application found. Either work inside a view function or push'
- ' an application context. See'
- ' http://flask-sqlalchemy.pocoo.org/contexts/.'
- )
- E RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1042: RuntimeError
- ____________________________________________________________________________________________ ERROR at setup of test_verified_email _____________________________________________________________________________________________
- new_user = <User 'fkpr[kfkuh'>
- @pytest.fixture()
- def init_database(new_user):
- # Create the database and the database table
- > db.create_all()
- app\tests\conftest.py:124:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1094: in create_all
- self._execute_for_all_tables(app, bind, 'create_all')
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1071: in _execute_for_all_tables
- app = self.get_app(app)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <SQLAlchemy engine=None>, reference_app = None
- def get_app(self, reference_app=None):
- """Helper method that implements the logic to look up an
- application."""
- if reference_app is not None:
- return reference_app
- if current_app:
- return current_app._get_current_object()
- if self.app is not None:
- return self.app
- > raise RuntimeError(
- 'No application found. Either work inside a view function or push'
- ' an application context. See'
- ' http://flask-sqlalchemy.pocoo.org/contexts/.'
- )
- E RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1042: RuntimeError
- ______________________________________________________________________________________________ ERROR at setup of test_valid_login ______________________________________________________________________________________________
- new_user = <User 'fkpr[kfkuh'>
- @pytest.fixture()
- def init_database(new_user):
- # Create the database and the database table
- > db.create_all()
- app\tests\conftest.py:124:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1094: in create_all
- self._execute_for_all_tables(app, bind, 'create_all')
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1071: in _execute_for_all_tables
- app = self.get_app(app)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <SQLAlchemy engine=None>, reference_app = None
- def get_app(self, reference_app=None):
- """Helper method that implements the logic to look up an
- application."""
- if reference_app is not None:
- return reference_app
- if current_app:
- return current_app._get_current_object()
- if self.app is not None:
- return self.app
- > raise RuntimeError(
- 'No application found. Either work inside a view function or push'
- ' an application context. See'
- ' http://flask-sqlalchemy.pocoo.org/contexts/.'
- )
- E RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
- ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1042: RuntimeError
- ======================================================================================================= warnings summary =======================================================================================================
- ..\..\..\..\anaconda3\lib\site-packages\flask\json\__init__.py:31
- C:\Users\nmyle\anaconda3\lib\site-packages\flask\json\__init__.py:31: DeprecationWarning: Importing 'itsdangerous.json' is deprecated and will be removed in ItsDangerous 2.1. Use Python's 'json' module instead.
- _slash_escape = "\\/" not in _json.dumps("/")
- ..\..\..\..\anaconda3\lib\site-packages\flask\json\__init__.py:61
- C:\Users\nmyle\anaconda3\lib\site-packages\flask\json\__init__.py:61: DeprecationWarning: Importing 'itsdangerous.json' is deprecated and will be removed in ItsDangerous 2.1. Use Python's 'json' module instead.
- class JSONEncoder(_json.JSONEncoder):
- ..\..\..\..\anaconda3\lib\site-packages\flask\json\__init__.py:103
- C:\Users\nmyle\anaconda3\lib\site-packages\flask\json\__init__.py:103: DeprecationWarning: Importing 'itsdangerous.json' is deprecated and will be removed in ItsDangerous 2.1. Use Python's 'json' module instead.
- class JSONDecoder(_json.JSONDecoder):
- -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
- =================================================================================================== short test summary info ====================================================================================================
- ERROR app/tests/functional/test_routes.py::test_register_page_get - RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
- ERROR app/tests/functional/test_routes.py::test_register_page_post - RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
- ERROR app/tests/functional/test_routes.py::test_verified_email - RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
- ERROR app/tests/functional/test_routes.py::test_valid_login - RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement