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
ImportError while importing test module '/Volumes/gsnedders/projects/wpt/web-platform-tests/webdriver/tests/classic/permissions/set.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
E ModuleNotFoundError: No module named 'permissions.set'
This is because:
(Pdb) pp sys.modules['permissions']
<module 'permissions' from '/Volumes/gsnedders/projects/wpt/web-platform-tests/webdriver/tests/bidi/external/permissions/__init__.py'>
This requires test module names to be unique when the test directory tree is not arranged in packages, because the modules will put in sys.modules after importing.
If we instead use the importlib import mechanism, we get:
ImportError while importing test module '/Volumes/gsnedders/projects/wpt/web-platform-tests/webdriver/tests/bidi/browser/create_user_context/__init__.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/bidi/browser/create_user_context/create_user_context.py:3: in <module>
from .. import get_user_context_ids
E ImportError: cannot import name 'get_user_context_ids' from 'webdriver.tests.bidi' (/Volumes/gsnedders/projects/wpt/web-platform-tests/webdriver/tests/bidi/__init__.py)
I'm confused as to how it's resolved .. to be webdriver.tests.bidi there (rather than webdriver.tests.bidi.browsers).
The text was updated successfully, but these errors were encountered:
Note pytest has significantly different behaviour when arguments (specifying files) are passed, which changes, among other things, how it finds the initial conftest.py.
This is a significance difference to my command in the original issue.
With:
You ultimately get a failure:
This is because:
Per the docs:
If we instead use the
importlib
import mechanism, we get:I'm confused as to how it's resolved
..
to bewebdriver.tests.bidi
there (rather thanwebdriver.tests.bidi.browsers
).The text was updated successfully, but these errors were encountered: