Guest User

Untitled

a guest
Apr 24th, 2022
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.65 KB | None | 0 0
  1.  ==
  2. platform win32 -- Python 3.10.4, pytest-7.1.1, pluggy-0.12.0
  3. rootdir: C:\Users\nmyle\OneDrive\Desktop\flaskcode\flaskblog2
  4. collected 2 items
  5.  
  6. app\tests\functional\test_login.py F                                                                                                [ 50%]
  7. app\tests\unit\test_models.py .                                                                                                     [100%]
  8.  
  9. ================================================================ FAILURES ================================================================
  10. ____________________________________________________________ test_login_page _____________________________________________________________
  11.  
  12.     def test_login_page():
  13.         """
  14.        GIVEN a Flask application configured for testing
  15.        WHEN the '/login' page requested (GET)
  16.        THEN check that the response is valid
  17.        """
  18.         # what is 'flask_test.cfg'?
  19. >       app = create_app('flask_test.cfg')
  20.  
  21. app\tests\functional\test_login.py:11:
  22. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  23. app\__init__.py:56: in create_app
  24.     app.config.from_object(config_class)
  25. ..\..\..\..\anaconda3\envs\flaskblog2\lib\site-packages\flask\config.py:162: in from_object
  26.     obj = import_string(obj)
  27. ..\..\..\..\anaconda3\envs\flaskblog2\lib\site-packages\werkzeug\utils.py:887: in import_string
  28.     raise ImportStringError(import_name, e).with_traceback(
  29. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
  30.  
  31. import_name = 'flask_test.cfg', silent = False
  32.  
  33.     def import_string(import_name: str, silent: bool = False) -> t.Any:
  34.         """Imports an object based on a string.  This is useful if you want to
  35.        use import paths as endpoints or something similar.  An import path can
  36.        be specified either in dotted notation (``xml.sax.saxutils.escape``)
  37.        or with a colon as object delimiter (``xml.sax.saxutils:escape``).
  38.  
  39.        If `silent` is True the return value will be `None` if the import fails.
  40.  
  41.        :param import_name: the dotted name for the object to import.
  42.        :param silent: if set to `True` import errors are ignored and
  43.                       `None` is returned instead.
  44.        :return: imported object
  45.        """
  46.         import_name = import_name.replace(":", ".")
  47.         try:
  48.             try:
  49.                 __import__(import_name)
  50.             except ImportError:
  51.                 if "." not in import_name:
  52.                     raise
  53.             else:
  54.                 return sys.modules[import_name]
  55.  
  56.             module_name, obj_name = import_name.rsplit(".", 1)
  57. >           module = __import__(module_name, globals(), locals(), [obj_name])
  58. E           werkzeug.utils.ImportStringError: import_string() failed for 'flask_test.cfg'. Possible reasons are:
  59. E
  60. E           - missing __init__.py in a package;
  61. E           - package or module path not included in sys.path;
  62. E           - duplicated package or module name taking precedence in sys.path;
  63. E           - missing module, class, function or variable;
  64. E
  65. E           Debugged import:
  66. E
  67. E           - 'flask_test' not found.
  68. E
  69. E           Original exception:
  70. E
  71. E           ModuleNotFoundError: No module named 'flask_test'
  72. E
  73. E           ModuleNotFoundError: No module named 'flask_test'
  74. E           ModuleNotFoundError: No module named 'flask_test'
  75. ..\..\..\..\anaconda3\envs\flaskblog2\lib\site-packages\werkzeug\utils.py:879: ImportStringError
  76. ============================================================ warnings summary ============================================================
  77. ..\..\..\..\anaconda3\envs\flaskblog2\lib\site-packages\flask_sqlalchemy\__init__.py:851  C:\Users\nmyle\anaconda3\envs\flaskblog2\lib\site-packages\flask_sqlalchemy\__init__.py:851: UserWarning: Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. Defaulting SQLALCHEMY_DATABASE_URI to "sqlite:///:memory:".
  78.     warnings.warn(
  79. ..\..\..\..\anaconda3\envs\flaskblog2\lib\site-packages\flask_sqlalchemy\__init__.py:872  C:\Users\nmyle\anaconda3\envs\flaskblog2\lib\site-packages\flask_sqlalchemy\__init__.py:872: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.
  80.  
  81.     warnings.warn(FSADeprecationWarning(
  82. -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html======================================================== short test summary info =========================================================
Advertisement
Add Comment
Please, Sign In to add comment