Advertisement
Guest User

error message

a guest
Aug 10th, 2022
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 11.69 KB | None | 0 0
  1. python -m pytest
  2. ===================================================================================================== test session starts ======================================================================================================
  3. platform win32 -- Python 3.9.12, pytest-7.1.2, pluggy-1.0.0
  4. rootdir: C:\Users\nmyle\OneDrive\Desktop\flaskcode\flaskblog2
  5. plugins: anyio-3.5.0
  6. collected 8 items
  7.  
  8. app\tests\test_testingpytest.py ...                                                                                                                                                                                       [ 37%]
  9. app\tests\functional\test_routes.py EEEE                                                                                                                                                                                  [ 87%]
  10. app\tests\unit\test_models.py .                                                                                                                                                                                           [100%]
  11.  
  12. ============================================================================================================ ERRORS ============================================================================================================
  13. ___________________________________________________________________________________________ ERROR at setup of test_register_page_get ___________________________________________________________________________________________
  14.  
  15. new_user = <User 'fkpr[kfkuh'>
  16.  
  17.     @pytest.fixture()
  18.     def init_database(new_user):
  19.    
  20.         # Create the database and the database table
  21. >       db.create_all()
  22.  
  23. app\tests\conftest.py:124:
  24. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  25. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1094: in create_all
  26.     self._execute_for_all_tables(app, bind, 'create_all')
  27. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1071: in _execute_for_all_tables
  28.     app = self.get_app(app)
  29. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  30.  
  31. self = <SQLAlchemy engine=None>, reference_app = None
  32.  
  33.     def get_app(self, reference_app=None):
  34.         """Helper method that implements the logic to look up an
  35.        application."""
  36.  
  37.         if reference_app is not None:
  38.             return reference_app
  39.  
  40.         if current_app:
  41.             return current_app._get_current_object()
  42.    
  43.         if self.app is not None:
  44.             return self.app
  45.  
  46. >       raise RuntimeError(
  47.             'No application found. Either work inside a view function or push'
  48.             ' an application context. See'
  49.             ' http://flask-sqlalchemy.pocoo.org/contexts/.'
  50.         )
  51. E       RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
  52.  
  53. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1042: RuntimeError
  54. __________________________________________________________________________________________ ERROR at setup of test_register_page_post ___________________________________________________________________________________________
  55.  
  56. new_user = <User 'fkpr[kfkuh'>
  57.  
  58.     @pytest.fixture()
  59.     def init_database(new_user):
  60.  
  61.         # Create the database and the database table
  62. >       db.create_all()
  63.  
  64. app\tests\conftest.py:124:
  65. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  66. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1094: in create_all
  67.     self._execute_for_all_tables(app, bind, 'create_all')
  68. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1071: in _execute_for_all_tables
  69.     app = self.get_app(app)
  70. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  71.  
  72. self = <SQLAlchemy engine=None>, reference_app = None
  73.  
  74.     def get_app(self, reference_app=None):
  75.         """Helper method that implements the logic to look up an
  76.        application."""
  77.  
  78.         if reference_app is not None:
  79.             return reference_app
  80.  
  81.         if current_app:
  82.             return current_app._get_current_object()
  83.    
  84.         if self.app is not None:
  85.             return self.app
  86.  
  87. >       raise RuntimeError(
  88.             'No application found. Either work inside a view function or push'
  89.             ' an application context. See'
  90.             ' http://flask-sqlalchemy.pocoo.org/contexts/.'
  91.         )
  92. E       RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
  93.  
  94. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1042: RuntimeError
  95. ____________________________________________________________________________________________ ERROR at setup of test_verified_email _____________________________________________________________________________________________
  96.  
  97. new_user = <User 'fkpr[kfkuh'>
  98.  
  99.     @pytest.fixture()
  100.     def init_database(new_user):
  101.  
  102.         # Create the database and the database table
  103. >       db.create_all()
  104.  
  105. app\tests\conftest.py:124:
  106. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  107. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1094: in create_all
  108.     self._execute_for_all_tables(app, bind, 'create_all')
  109. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1071: in _execute_for_all_tables
  110.     app = self.get_app(app)
  111. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  112.  
  113. self = <SQLAlchemy engine=None>, reference_app = None
  114.  
  115.     def get_app(self, reference_app=None):
  116.         """Helper method that implements the logic to look up an
  117.        application."""
  118.  
  119.         if reference_app is not None:
  120.             return reference_app
  121.  
  122.         if current_app:
  123.             return current_app._get_current_object()
  124.  
  125.         if self.app is not None:
  126.             return self.app
  127.  
  128. >       raise RuntimeError(
  129.             'No application found. Either work inside a view function or push'
  130.             ' an application context. See'
  131.             ' http://flask-sqlalchemy.pocoo.org/contexts/.'
  132.         )
  133. E       RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
  134.  
  135. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1042: RuntimeError
  136. ______________________________________________________________________________________________ ERROR at setup of test_valid_login ______________________________________________________________________________________________
  137.  
  138. new_user = <User 'fkpr[kfkuh'>
  139.  
  140.     @pytest.fixture()
  141.     def init_database(new_user):
  142.  
  143.         # Create the database and the database table
  144. >       db.create_all()
  145.  
  146. app\tests\conftest.py:124:
  147. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  148. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1094: in create_all
  149.     self._execute_for_all_tables(app, bind, 'create_all')
  150. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1071: in _execute_for_all_tables
  151.     app = self.get_app(app)
  152. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  153.  
  154. self = <SQLAlchemy engine=None>, reference_app = None
  155.  
  156.     def get_app(self, reference_app=None):
  157.         """Helper method that implements the logic to look up an
  158.        application."""
  159.  
  160.         if reference_app is not None:
  161.             return reference_app
  162.  
  163.         if current_app:
  164.             return current_app._get_current_object()
  165.    
  166.         if self.app is not None:
  167.             return self.app
  168.  
  169. >       raise RuntimeError(
  170.             'No application found. Either work inside a view function or push'
  171.             ' an application context. See'
  172.             ' http://flask-sqlalchemy.pocoo.org/contexts/.'
  173.         )
  174. E       RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
  175.  
  176. ..\..\..\..\anaconda3\lib\site-packages\flask_sqlalchemy\__init__.py:1042: RuntimeError
  177. ======================================================================================================= warnings summary =======================================================================================================
  178. ..\..\..\..\anaconda3\lib\site-packages\flask\json\__init__.py:31
  179.   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.
  180.    _slash_escape = "\\/" not in _json.dumps("/")
  181.  
  182. ..\..\..\..\anaconda3\lib\site-packages\flask\json\__init__.py:61
  183.  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.
  184.     class JSONEncoder(_json.JSONEncoder):
  185.  
  186. ..\..\..\..\anaconda3\lib\site-packages\flask\json\__init__.py:103
  187.   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.
  188.    class JSONDecoder(_json.JSONDecoder):
  189.  
  190. -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
  191. =================================================================================================== short test summary info ====================================================================================================
  192. 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/.      
  193. 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/.    
  194. 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/.
  195. 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