Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests failing on latest Flask version 2.2.1 #4739

Closed
hiteshgoyal18 opened this issue Aug 4, 2022 · 3 comments
Closed

Tests failing on latest Flask version 2.2.1 #4739

hiteshgoyal18 opened this issue Aug 4, 2022 · 3 comments

Comments

@hiteshgoyal18
Copy link

Hi All,
I am working on a Flask project and suddenly my unit tests start failing on the latest flask version 2.2.1
Got following error while running tox command

/usr/lib/python3.8/doctest.py:939: in find
self._find(tests, obj, name, module, source_lines, globs, {})
.tox/tests/lib/python3.8/site-packages/_pytest/doctest.py:533: in _find
super()._find( # type:ignore[misc]
/usr/lib/python3.8/doctest.py:998: in _find
if ((inspect.isroutine(inspect.unwrap(val))
.tox/tests/lib/python3.8/site-packages/_pytest/doctest.py:475: in _mock_aware_unwrap
return real_unwrap(func, stop=_is_mocked)
/usr/lib/python3.8/inspect.py:520: in unwrap
while _is_wrapper(func):
/usr/lib/python3.8/inspect.py:514: in _is_wrapper
return hasattr(f, 'wrapped') and not stop(f)
.tox/tests/lib/python3.8/site-packages/werkzeug/local.py:316: in get
obj = instance._get_current_object() # type: ignore[misc]
.tox/tests/lib/python3.8/site-packages/werkzeug/local.py:509: in _get_current_object
raise RuntimeError(unbound_message) from None
E RuntimeError: Working outside of request context.
E
E This typically means that you attempted to use functionality that needed
E an active HTTP request. Consult the documentation on testing for
E information about how to avoid this problem.

When I changed my flask version back to 2.1.3 it started working again.

@hiteshgoyal18 hiteshgoyal18 changed the title Tests failing on latest Flask version Tests failing on latest Flask version 2.2.1 Aug 4, 2022
@hiteshgoyal18
Copy link
Author

Also, I am using latest version of pytest 7.1.2

@targhs
Copy link

targhs commented Aug 4, 2022

A small reproducible code sample will be appreciated

@davidism
Copy link
Member

davidism commented Aug 4, 2022

Duplicate of pallets/werkzeug#2485

@davidism davidism marked this as a duplicate of pallets/werkzeug#2485 Aug 4, 2022
@davidism davidism closed this as completed Aug 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants