Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ==
- platform win32 -- Python 3.10.4, pytest-7.1.1, pluggy-0.12.0
- rootdir: C:\Users\nmyle\OneDrive\Desktop\flaskcode\flaskblog2
- collected 2 items
- app\tests\functional\test_login.py F [ 50%]
- app\tests\unit\test_models.py . [100%]
- ================================================================ FAILURES ================================================================
- ____________________________________________________________ test_login_page _____________________________________________________________
- def test_login_page():
- """
- GIVEN a Flask application configured for testing
- WHEN the '/login' page requested (GET)
- THEN check that the response is valid
- """
- # what is 'flask_test.cfg'?
- > app = create_app('flask_test.cfg')
- app\tests\functional\test_login.py:11:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- app\__init__.py:56: in create_app
- app.config.from_object(config_class)
- ..\..\..\..\anaconda3\envs\flaskblog2\lib\site-packages\flask\config.py:162: in from_object
- obj = import_string(obj)
- ..\..\..\..\anaconda3\envs\flaskblog2\lib\site-packages\werkzeug\utils.py:887: in import_string
- raise ImportStringError(import_name, e).with_traceback(
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- import_name = 'flask_test.cfg', silent = False
- def import_string(import_name: str, silent: bool = False) -> t.Any:
- """Imports an object based on a string. This is useful if you want to
- use import paths as endpoints or something similar. An import path can
- be specified either in dotted notation (``xml.sax.saxutils.escape``)
- or with a colon as object delimiter (``xml.sax.saxutils:escape``).
- If `silent` is True the return value will be `None` if the import fails.
- :param import_name: the dotted name for the object to import.
- :param silent: if set to `True` import errors are ignored and
- `None` is returned instead.
- :return: imported object
- """
- import_name = import_name.replace(":", ".")
- try:
- try:
- __import__(import_name)
- except ImportError:
- if "." not in import_name:
- raise
- else:
- return sys.modules[import_name]
- module_name, obj_name = import_name.rsplit(".", 1)
- > module = __import__(module_name, globals(), locals(), [obj_name])
- E werkzeug.utils.ImportStringError: import_string() failed for 'flask_test.cfg'. Possible reasons are:
- E
- E - missing __init__.py in a package;
- E - package or module path not included in sys.path;
- E - duplicated package or module name taking precedence in sys.path;
- E - missing module, class, function or variable;
- E
- E Debugged import:
- E
- E - 'flask_test' not found.
- E
- E Original exception:
- E
- E ModuleNotFoundError: No module named 'flask_test'
- E
- E ModuleNotFoundError: No module named 'flask_test'
- E ModuleNotFoundError: No module named 'flask_test'
- ..\..\..\..\anaconda3\envs\flaskblog2\lib\site-packages\werkzeug\utils.py:879: ImportStringError
- ============================================================ warnings summary ============================================================
- ..\..\..\..\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:".
- warnings.warn(
- ..\..\..\..\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.
- warnings.warn(FSADeprecationWarning(
- -- 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