Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork16.7k
Closed
Description
For more information:pytest-dev/pytest#5532
https://www.python.org/dev/peps/pep-0451/#api-changes
A compliant PEP 451 loader can avoid a lot of the tricky APIs just through implementingfind_spect -- in this caseis_package is replaced bysubmodule_search_locations being truthy
I'll see if I can't take a stab at this, it looks like this is a reopen of#487
Here's a minimal example:
importflaskapp=flask.Flask(__name__)deftest():pass
$pytest t.py============================= test session starts ==============================platform linux -- Python 3.6.7, pytest-5.0.0, py-1.8.0, pluggy-0.12.0rootdir: /tmp/xcollected 0 items / 1 errors==================================== ERRORS ====================================____________________________ ERROR collecting t.py _____________________________t.py:3: in <module> app = flask.Flask(__name__)venv/lib/python3.6/site-packages/flask/app.py:381: in __init__ instance_path = self.auto_find_instance_path()venv/lib/python3.6/site-packages/flask/app.py:678: in auto_find_instance_path prefix, package_path = find_package(self.import_name)venv/lib/python3.6/site-packages/flask/helpers.py:826: in find_package loader, root_mod_name):venv/lib/python3.6/site-packages/flask/helpers.py:789: in _matching_loader_thinks_module_is_package loader.__class__.__name__)E AttributeError: AssertionRewritingHook.is_package() method is missing but is required by Flask of PEP 302 import hooks. If you do not use import hooks and you encounter this error please file a bug against Flask.!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!=========================== 1 error in 0.31 seconds ============================
$pip freeze --allatomicwrites==1.3.0attrs==19.1.0Click==7.0Flask==1.0.3importlib-metadata==0.18itsdangerous==1.1.0Jinja2==2.10.1MarkupSafe==1.1.1more-itertools==7.1.0packaging==19.0pip==19.1.1pluggy==0.12.0py==1.8.0pyparsing==2.4.0pytest==5.0.0setuptools==41.0.1six==1.12.0wcwidth==0.1.7Werkzeug==0.15.4wheel==0.33.4zipp==0.5.1
Metadata
Metadata
Assignees
Labels
No labels