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

Error collecting tests: AttributeError: 'str' object has no attribute '__spec__' #151

Open
nicoddemus opened this issue Dec 9, 2022 · 0 comments

Comments

@nicoddemus
Copy link
Member

https://github.com/ESSS/qmxgraph/actions/runs/3656977152/jobs/6180039932

============================= test session starts ==============================
platform linux -- Python 3.6.15, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/share/miniconda/envs/qmxgraph/bin/python
cachedir: .pytest_cache
metadata: {'Python': '3.6.15', 'Platform': 'Linux-5.15.0-1024-azure-x86_64-with-debian-bookworm-sid', 'Packages': {'pytest': '6.2.5', 'py': '1.11.0', 'pluggy': '1.0.0'}, 'Plugins': {'hypothesis': '3.11.0', 'metadata': '1.11.0', 'qt': '4.0.2', 'timeout': '2.1.0', 'mock': '3.6.1', 'cov': '2.5.1', 'base-url': '1.4.1', 'xvfb': '2.0.0', 'html': '3.2.0', 'selenium': '1.17.0', 'rerunfailures': '10.3', 'variables': '1.7.1'}, 'CI': 'true', 'JAVA_HOME': '/usr/lib/jvm/temurin-11-jdk-amd64', 'Base URL': '', 'Driver': 'PhantomJS', 'Capabilities': {}}
PyQt5 5.12.3 -- Qt runtime 5.12.9 -- Qt compiled 5.12.9
driver: PhantomJS
sensitiveurl: .*
rootdir: /home/runner/work/qmxgraph/qmxgraph, configfile: pytest.ini
plugins: hypothesis-3.11.0, metadata-1.11.0, qt-4.0.2, timeout-2.1.0, mock-3.6.1, cov-2.5.1, base-url-1.4.1, xvfb-2.0.0, html-3.2.0, selenium-1.17.0, rerunfailures-10.3, variables-1.7.1
timeout: 30.0s
timeout method: signal
timeout func_only: False
collecting ... collected 31 items / 1 error / 30 selected

==================================== ERRORS ====================================
___________________ ERROR collecting tests/test_js_graph.py ____________________
tests/test_js_graph.py:14: in <module>
    from qmxgraph import server
src/qmxgraph/server.py:9: in <module>
    import cherrypy
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/cherrypy/__init__.py:66: in <module>
    from ._cperror import (
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/cherrypy/_cperror.py:135: in <module>
    from cherrypy.lib import httputil as _httputil
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/cherrypy/lib/httputil.py:20: in <module>
    import jaraco.collections
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/jaraco/collections.py:10: in <module>
    import jaraco.text
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/jaraco/text/__init__.py:228: in <module>
    lorem_ipsum = resources.read_text(__name__, 'Lorem ipsum.txt')  # type: ignore
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_legacy.py:25: in wrapper
    return func(*args, **kwargs)
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_legacy.py:79: in read_text
    with open_text(package, resource, encoding, errors) as fp:
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_legacy.py:25: in wrapper
    return func(*args, **kwargs)
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_legacy.py:62: in open_text
    return (_common.files(package) / normalize_path(resource)).open(
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_common.py:46: in wrapper
    return func(anchor)
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_common.py:56: in files
    return from_package(resolve(anchor))
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_common.py:112: in from_package
    spec = wrap_spec(package)
/usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_compat.py:101: in wrap_spec
    return _adapters.SpecLoaderAdapter(package.__spec__, TraversableResourcesLoader)
E   AttributeError: 'str' object has no attribute '__spec__'
=============================== warnings summary ===============================
../../../../../usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/jaraco/text/__init__.py:228
  /usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/jaraco/text/__init__.py:228: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    lorem_ipsum = resources.read_text(__name__, 'Lorem ipsum.txt')  # type: ignore

../../../../../usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_legacy.py:79
  /usr/share/miniconda/envs/qmxgraph/lib/python3.6/site-packages/importlib_resources/_legacy.py:79: DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    with open_text(package, resource, encoding, errors) as fp:

-- Docs: https://docs.pytest.org/en/stable/warnings.html

---------- coverage: platform linux, python 3.6.15-final-0 -----------
Name                                    Stmts   Miss  Cover
-----------------------------------------------------------
src/qmxgraph/__init__.py                    1      0   100%
src/qmxgraph/_web_view.py                  89     48    46%
src/qmxgraph/api.py                       226    118    48%
src/qmxgraph/cell_bounds.py                21      5    76%
src/qmxgraph/configuration.py              44     16    64%
src/qmxgraph/constants.py                   7      0   100%
src/qmxgraph/debug.py                       5      2    60%
src/qmxgraph/exceptions.py                  3      0   100%
src/qmxgraph/extra_attr_validators.py      12      8    33%
src/qmxgraph/js.py                         13      5    62%
src/qmxgraph/mime.py                       12      9    25%
src/qmxgraph/resource_mxgraph.py           16      3    81%
src/qmxgraph/resource_qmxgraph.py          16      3    81%
src/qmxgraph/server.py                     82     79     4%
src/qmxgraph/waiting.py                    50     29    [42](https://github.com/ESSS/qmxgraph/actions/runs/3656977152/jobs/6180039932#step:6:43)%
src/qmxgraph/widget.py                    316    192    39%
-----------------------------------------------------------
TOTAL                                     913    517    [43](https://github.com/ESSS/qmxgraph/actions/runs/3656977152/jobs/6180039932#step:6:44)%

=========================== short test summary info ============================
ERROR tests/test_js_graph.py - AttributeError: 'str' object has no attribute ...
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
========================= 2 warnings, 1 error in 1.[97](https://github.com/ESSS/qmxgraph/actions/runs/3656977152/jobs/6180039932#step:6:98)s =========================
nicoddemus added a commit that referenced this issue Dec 9, 2022
@nicoddemus nicoddemus mentioned this issue Dec 9, 2022
nicoddemus added a commit that referenced this issue Dec 9, 2022
`5.10` (the latst version) seems to be incompatible with `jaraco.text`, which is an indirect dependency of `cherrypy`.

Fix #151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant