You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,this is a magnificent project. I'm currently learning about it.
when I run the code pytest --alluredir=output/allure-result
it will happen mistake, about
tests\test_user\test_user_add_del.py:14: in <module>
from src.client.flask_client.flask_client import flask_clinet
src\client\flask_client\flask_client.py:10: in <module>
config = settings.flask
..\..\anaconda3\envs\pytest\lib\site-packages\dynaconf\base.py:144: in __getattr__
value = getattr(self._wrapped, name)
..\..\anaconda3\envs\pytest\lib\site-packages\dynaconf\base.py:325: in __getattribute__
return super().__getattribute__(name)
E AttributeError: 'Settings' object has no attribute 'FLASK'
I searched online for a long time but couldn't find a solution. Did I make a mistake somewhere?
tests/test_user/test_user_add_del.py imports flask_clinet, and src/client/flask_client/flask_client.py initializes it at import time using settings.flask.
But in some setups, conf/settings.yaml does not contain a flask section for the active environment, so Dynaconf raises: AttributeError: 'Settings' object has no attribute 'FLASK'
Why it says FLASK while code uses settings.flask
Dynaconf treats config keys case-insensitively and normalizes keys internally (commonly uppercase style).
So settings.flask and settings.FLASK point to the same config entry.
If that entry does not exist in the current environment, you will get an error like “no attribute FLASK”.
What we changed
Added flask config section in conf/settings.yaml (boe/online).
Added defensive fallback in Flask client initialization:
if flask config is missing or backend login fails, tests won’t crash at import stage.
Flask-dependent tests now skip gracefully when backend is unavailable, instead of failing during collection.
Why you may still see skipped tests
Those tests require a running backend service and valid SSL/endpoint.
If backend is unavailable (or cert is invalid), tests are skipped by design.
For local setup
Please ensure:
conf/settings.yaml has flask.host/account/password in your current env
backend service is running and reachable
SSL cert is valid (if using HTTPS)
Thanks again — your report helped improve beginner experience significantly.
Activity
ljxpython commentedon Feb 20, 2026
Hi @cc1oud, thanks a lot for reporting this and for trying the project.
You didn’t make a mistake — this is a real project-side issue, and your traceback is valid.
Also for context: the basic version is here:
https://github.com/ljxpython/pytest_framework/tree/archive_v1
Most current features are wrapped and extended from that base architecture.
Root cause
tests/test_user/test_user_add_del.pyimportsflask_clinet, andsrc/client/flask_client/flask_client.pyinitializes it at import time usingsettings.flask.But in some setups,
conf/settings.yamldoes not contain aflasksection for the active environment, so Dynaconf raises:AttributeError: 'Settings' object has no attribute 'FLASK'Why it says FLASK while code uses settings.flask
Dynaconf treats config keys case-insensitively and normalizes keys internally (commonly uppercase style).
So
settings.flaskandsettings.FLASKpoint to the same config entry.If that entry does not exist in the current environment, you will get an error like “no attribute FLASK”.
What we changed
flaskconfig section inconf/settings.yaml(boe/online).flaskconfig is missing or backend login fails, tests won’t crash at import stage.Why you may still see skipped tests
Those tests require a running backend service and valid SSL/endpoint.
If backend is unavailable (or cert is invalid), tests are skipped by design.
For local setup
Please ensure:
conf/settings.yamlhasflask.host/account/passwordin your current envThanks again — your report helped improve beginner experience significantly.