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

INTERNALERROR for no apparent reason #10846

Closed
yurivict opened this issue Mar 29, 2023 · 5 comments
Closed

INTERNALERROR for no apparent reason #10846

yurivict opened this issue Mar 29, 2023 · 5 comments

Comments

@yurivict
Copy link

Bug report

Tests fail on the QtPy project like this:

cd /usr/ports/devel/py-QtPy/work-py39/QtPy-2.3.1 && /usr/bin/env XDG_DATA_HOME=/usr/ports/devel/py-QtPy/work-py39  XDG_CONFIG_HOME=/usr/ports/devel/py-QtPy/work-py39  XDG_CACHE_HOME=/usr/ports/devel/py-QtPy/work-py39/.cache  HOME=/usr/ports/devel/py-QtPy/work-py39 PATH=/usr/local/libexec/ccache:/usr/ports/devel/py-QtPy/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/devel/py-QtPy/work-py39/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" /usr/local/bin/python3.9 -m pytest -k '' -rs -v -o addopts= 
/usr/local/lib/python3.9/site-packages/pytestqt/logging.py:42: PytestDeprecationWarning: The hookimpl QtLoggingPlugin.pytest_runtest_makereport uses old-style configuration options (marks or attributes).
Please use the pytest.hookimpl(hookwrapper=True) decorator instead
 to configure the hooks.
 See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers
  @pytest.mark.hookwrapper
========================================================================================== test session starts ==========================================================================================
platform freebsd13 -- Python 3.9.16, pytest-7.2.1, pluggy-1.0.0 -- /usr/local/bin/python3.9
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/usr/ports/devel/py-QtPy/work-py39/QtPy-2.3.1/.hypothesis/examples')
Using --randomly-seed=1870392973
PySide2 5.15.2 -- Qt runtime 5.15.8 -- Qt compiled 5.15.8
rootdir: /usr/ports/devel/py-QtPy/work-py39/QtPy-2.3.1, configfile: pytest.ini, testpaths: qtpy/tests
plugins: forked-1.4.0, hypothesis-6.68.2, mypy-plugins-1.10.1, cov-2.9.0, randomly-3.12.0, timeout-2.1.0, rerunfailures-10.1, flaky-3.7.0, xdist-2.5.0, env-0.6.2, freezegun-0.4.2, mock-3.10.0, flake8-1.1.1, typeguard-3.0.2, qt-4.1.0
collected 105 items / 1 skipped                                                                                                                                                                         
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 270, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 334, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 667, in perform_collect
INTERNALERROR>     hook.pytest_collection_modifyitems(
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pytest_freezegun.py", line 55, in pytest_collection_modifyitems
INTERNALERROR>     if get_closest_marker(item, MARKER_NAME):
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pytest_freezegun.py", line 17, in get_closest_marker
INTERNALERROR>     if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/version.py", line 55, in __init__
INTERNALERROR>     warnings.warn(
INTERNALERROR> DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

========================================================================================== 1 skipped in 1.84s ===========================================================================================
*** Error code 3

Original bug report: spyder-ide/qtpy#418

What triggers the INTERNALERROR message?
How can this be fixed?

Your environment

  • CPython versions tested on: 3.9
  • Operating system and architecture: FreeBSD 13.1
@CAM-Gerlach
Copy link

I'm not a Pytest maintainer, but it seems the issue is not in fact with Pytest but rather a Pytest plugin, https://github.com/ktosiek/pytest-freezegun , that you happen have installed in your environment (it isn't a QtPy test dependency) that Pytest tries to load. That issue is has been reported several years ago, as ktosiek/pytest-freezegun#35 , and has had multiple PRs open to fix it, but unfortunately pytest-freezegun is effectively unmaintained and development has moved to a forked replacement, https://github.com/pytest-dev/pytest-freezer under the Pytest org (where it has long been fixed).

Therefore, I recommend:

  • Closing this issue since it is not a bug with Pytest, and either
  • Uninstalling pytest-freezegun and installing pytest-freezer to replace it, or
  • Running QtPy's tests in a clean environment without it

Thanks, and best of luck.

@yurivict
Copy link
Author

Thanks for your analysis. I indeed had py39-pytest-freezegun-0.4.2 installed.

@yurivict yurivict closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2023
@Vicky8640
Copy link

I am getting the same error but i have no freeze-gun installed

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages_pytest\main.py", line 271, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages_pytest\main.py", line 325, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_hooks.py", line 433, in call
INTERNALERROR> return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_manager.py", line 112, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_callers.py", line 155, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_result.py", line 108, in get_result
INTERNALERROR> raise exc.with_traceback(exc.traceback)
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_callers.py", line 80, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages_pytest\main.py", line 350, in pytest_runtestloop
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_hooks.py", line 433, in call
INTERNALERROR> return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_manager.py", line 112, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_callers.py", line 155, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_result.py", line 108, in get_result
INTERNALERROR> raise exc.with_traceback(exc.traceback)
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_callers.py", line 80, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages_pytest\runner.py", line 114, in pytest_runtest_protocol
INTERNALERROR> runtestprotocol(item, nextitem=nextitem)
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages_pytest\runner.py", line 127, in runtestprotocol
INTERNALERROR> rep = call_and_report(item, "setup", log)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages_pytest\runner.py", line 224, in call_and_report
INTERNALERROR> report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_hooks.py", line 433, in call
INTERNALERROR> return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_manager.py", line 112, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "F:\Tutorials\Python\Lib\site-packages\pluggy_callers.py", line 133, in _multicall
INTERNALERROR> teardown[0].send(outcome)
INTERNALERROR> File "F:\Tutorials\Selenium\SNATADMIN PORTAL\Tests\conftest.py", line 61, in pytest_runtest_makereport
INTERNALERROR> _capture_screenshot(file_name)
INTERNALERROR> File "F:\Tutorials\Selenium\SNATADMIN PORTAL\Tests\conftest.py", line 68, in _capture_screenshot
INTERNALERROR> driver.get_screenshot_as_file(name)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> AttributeError: 'NoneType' object has no attribute 'get_screenshot_as_file'

============================= 3 warnings in 9.68s =============================

Test ignored.

@Vicky8640
Copy link

Test Environment
Python 3.11.4

@The-Compiler
Copy link
Member

The-Compiler commented Oct 2, 2023

@Vicky8640 this is a bug in your conftest.py as apparent in the traceback:

Traceback (most recent call last):
[...]
File "F:\Tutorials\Selenium\SNATADMIN PORTAL\Tests\conftest.py", line 61, in pytest_runtest_makereport
    _capture_screenshot(file_name)
File "F:\Tutorials\Selenium\SNATADMIN PORTAL\Tests\conftest.py", line 68, in _capture_screenshot
    driver.get_screenshot_as_file(name)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_screenshot_as_file'

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

No branches or pull requests

4 participants