-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
7.4.0: pytest is failing with internal error on testing mypy
(possible bug in pytest?)
#11201
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
Comments
mypy
(possible bug in pytest?)
At first glance this looks like a custom collector missing a implicitly assumed api Please provide output with --fulltrace so we can also observe the full error |
Here it is: INTERNALERROR> def worker_internal_error(self, node, formatted_error):
INTERNALERROR> """
INTERNALERROR> pytest_internalerror() was called on the worker.
INTERNALERROR>
INTERNALERROR> pytest_internalerror() arguments are an excinfo and an excrepr, which can't
INTERNALERROR> be serialized, so we go with a poor man's solution of raising an exception
INTERNALERROR> here ourselves using the formatted message.
INTERNALERROR> """
INTERNALERROR> self._active_nodes.remove(node)
INTERNALERROR> try:
INTERNALERROR> > assert False, formatted_error
INTERNALERROR> E AssertionError: config = <_pytest.config.Config object at 0x7fae4647ca00>
INTERNALERROR> E doit = <function _main at 0x7fae469bde50>
INTERNALERROR> E
INTERNALERROR> E def wrap_session(
INTERNALERROR> E config: Config, doit: Callable[[Config, "Session"], Optional[Union[int, ExitCode]]]
INTERNALERROR> E ) -> Union[int, ExitCode]:
INTERNALERROR> E """Skeleton command line program."""
INTERNALERROR> E session = Session.from_config(config)
INTERNALERROR> E session.exitstatus = ExitCode.OK
INTERNALERROR> E initstate = 0
INTERNALERROR> E try:
INTERNALERROR> E try:
INTERNALERROR> E config._do_configure()
INTERNALERROR> E initstate = 1
INTERNALERROR> E config.hook.pytest_sessionstart(session=session)
INTERNALERROR> E initstate = 2
INTERNALERROR> E > session.exitstatus = doit(config, session) or 0
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/_pytest/main.py:270:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E config = <_pytest.config.Config object at 0x7fae4647ca00>
INTERNALERROR> E session = <Session mypy-1.4.1 exitstatus=<ExitCode.INTERNAL_ERROR: 3> testsfailed=0 testscollected=11206>
INTERNALERROR> E
INTERNALERROR> E def _main(config: Config, session: "Session") -> Optional[Union[int, ExitCode]]:
INTERNALERROR> E """Default command line protocol for initialization, session,
INTERNALERROR> E running tests and reporting."""
INTERNALERROR> E config.hook.pytest_collection(session=session)
INTERNALERROR> E > config.hook.pytest_runtestloop(session=session)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/_pytest/main.py:324:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E self = <_HookCaller 'pytest_runtestloop'>, args = ()
INTERNALERROR> E kwargs = {'session': <Session mypy-1.4.1 exitstatus=<ExitCode.INTERNAL_ERROR: 3> testsfailed=0 testscollected=11206>}
INTERNALERROR> E argname = 'session', firstresult = True
INTERNALERROR> E
INTERNALERROR> E def __call__(self, *args, **kwargs):
INTERNALERROR> E if args:
INTERNALERROR> E raise TypeError("hook calling supports only keyword arguments")
INTERNALERROR> E assert not self.is_historic()
INTERNALERROR> E
INTERNALERROR> E # This is written to avoid expensive operations when not needed.
INTERNALERROR> E if self.spec:
INTERNALERROR> E for argname in self.spec.argnames:
INTERNALERROR> E if argname not in kwargs:
INTERNALERROR> E notincall = tuple(set(self.spec.argnames) - kwargs.keys())
INTERNALERROR> E warnings.warn(
INTERNALERROR> E "Argument(s) {} which are declared in the hookspec "
INTERNALERROR> E "can not be found in this hook call".format(notincall),
INTERNALERROR> E stacklevel=2,
INTERNALERROR> E )
INTERNALERROR> E break
INTERNALERROR> E
INTERNALERROR> E firstresult = self.spec.opts.get("firstresult")
INTERNALERROR> E else:
INTERNALERROR> E firstresult = False
INTERNALERROR> E
INTERNALERROR> E > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/pluggy/_hooks.py:265:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E self = <_pytest.config.PytestPluginManager object at 0x7fae47b7ebb0>
INTERNALERROR> E hook_name = 'pytest_runtestloop'
INTERNALERROR> E methods = [<HookImpl plugin_name='main', plugin=<module '_pytest.main' from '/usr/lib/python3.8/site-packages/_pytest/main.py'>>...ae4647ce20>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x7fae45fdc370>>]
INTERNALERROR> E kwargs = {'session': <Session mypy-1.4.1 exitstatus=<ExitCode.INTERNAL_ERROR: 3> testsfailed=0 testscollected=11206>}
INTERNALERROR> E firstresult = True
INTERNALERROR> E
INTERNALERROR> E def _hookexec(self, hook_name, methods, kwargs, firstresult):
INTERNALERROR> E # called from all hookcaller instances.
INTERNALERROR> E # enable_tracing will set its own wrapping function at self._inner_hookexec
INTERNALERROR> E > return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/pluggy/_manager.py:80:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E self = <__channelexec__.WorkerInteractor object at 0x7fae4647ce20>
INTERNALERROR> E session = <Session mypy-1.4.1 exitstatus=<ExitCode.INTERNAL_ERROR: 3> testsfailed=0 testscollected=11206>
INTERNALERROR> E
INTERNALERROR> E @pytest.hookimpl
INTERNALERROR> E def pytest_runtestloop(self, session):
INTERNALERROR> E self.log("entering main loop")
INTERNALERROR> E self.channel.setcallback(self.handle_command, endmarker=self.SHUTDOWN_MARK)
INTERNALERROR> E self.nextitem_index = self._get_next_item_index()
INTERNALERROR> E while self.nextitem_index is not self.SHUTDOWN_MARK:
INTERNALERROR> E > self.run_one_test()
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/xdist/remote.py:157:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E self = <__channelexec__.WorkerInteractor object at 0x7fae4647ce20>
INTERNALERROR> E
INTERNALERROR> E def run_one_test(self):
INTERNALERROR> E self.item_index = self.nextitem_index
INTERNALERROR> E self.nextitem_index = self._get_next_item_index()
INTERNALERROR> E
INTERNALERROR> E items = self.session.items
INTERNALERROR> E item = items[self.item_index]
INTERNALERROR> E if self.nextitem_index is self.SHUTDOWN_MARK:
INTERNALERROR> E nextitem = None
INTERNALERROR> E else:
INTERNALERROR> E nextitem = items[self.nextitem_index]
INTERNALERROR> E
INTERNALERROR> E worker_title("[pytest-xdist running] %s" % item.nodeid)
INTERNALERROR> E
INTERNALERROR> E start = time.time()
INTERNALERROR> E > self.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/xdist/remote.py:174:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E self = <_HookCaller 'pytest_runtest_protocol'>, args = ()
INTERNALERROR> E kwargs = {'item': <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>, 'nextitem': <DataDrivenTestCase testTypedPkgSimple>}
INTERNALERROR> E argname = 'nextitem', firstresult = True
INTERNALERROR> E
INTERNALERROR> E def __call__(self, *args, **kwargs):
INTERNALERROR> E if args:
INTERNALERROR> E raise TypeError("hook calling supports only keyword arguments")
INTERNALERROR> E assert not self.is_historic()
INTERNALERROR> E
INTERNALERROR> E # This is written to avoid expensive operations when not needed.
INTERNALERROR> E if self.spec:
INTERNALERROR> E for argname in self.spec.argnames:
INTERNALERROR> E if argname not in kwargs:
INTERNALERROR> E notincall = tuple(set(self.spec.argnames) - kwargs.keys())
INTERNALERROR> E warnings.warn(
INTERNALERROR> E "Argument(s) {} which are declared in the hookspec "
INTERNALERROR> E "can not be found in this hook call".format(notincall),
INTERNALERROR> E stacklevel=2,
INTERNALERROR> E )
INTERNALERROR> E break
INTERNALERROR> E
INTERNALERROR> E firstresult = self.spec.opts.get("firstresult")
INTERNALERROR> E else:
INTERNALERROR> E firstresult = False
INTERNALERROR> E
INTERNALERROR> E > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/pluggy/_hooks.py:265:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E self = <_pytest.config.PytestPluginManager object at 0x7fae47b7ebb0>
INTERNALERROR> E hook_name = 'pytest_runtest_protocol'
INTERNALERROR> E methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/usr/lib/python3.8/site-packages/_pytest/runner...lugin_name='warnings', plugin=<module '_pytest.warnings' from '/usr/lib/python3.8/site-packages/_pytest/warnings.py'>>]
INTERNALERROR> E kwargs = {'item': <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>, 'nextitem': <DataDrivenTestCase testTypedPkgSimple>}
INTERNALERROR> E firstresult = True
INTERNALERROR> E
INTERNALERROR> E def _hookexec(self, hook_name, methods, kwargs, firstresult):
INTERNALERROR> E # called from all hookcaller instances.
INTERNALERROR> E # enable_tracing will set its own wrapping function at self._inner_hookexec
INTERNALERROR> E > return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/pluggy/_manager.py:80:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E item = <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>
INTERNALERROR> E nextitem = <DataDrivenTestCase testTypedPkgSimple>
INTERNALERROR> E
INTERNALERROR> E def pytest_runtest_protocol(item: Item, nextitem: Optional[Item]) -> bool:
INTERNALERROR> E ihook = item.ihook
INTERNALERROR> E ihook.pytest_runtest_logstart(nodeid=item.nodeid, location=item.location)
INTERNALERROR> E > runtestprotocol(item, nextitem=nextitem)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/_pytest/runner.py:114:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E item = <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>, log = True
INTERNALERROR> E nextitem = <DataDrivenTestCase testTypedPkgSimple>
INTERNALERROR> E
INTERNALERROR> E def runtestprotocol(
INTERNALERROR> E item: Item, log: bool = True, nextitem: Optional[Item] = None
INTERNALERROR> E ) -> List[TestReport]:
INTERNALERROR> E hasrequest = hasattr(item, "_request")
INTERNALERROR> E if hasrequest and not item._request: # type: ignore[attr-defined]
INTERNALERROR> E # This only happens if the item is re-run, as is done by
INTERNALERROR> E # pytest-rerunfailures.
INTERNALERROR> E item._initrequest() # type: ignore[attr-defined]
INTERNALERROR> E rep = call_and_report(item, "setup", log)
INTERNALERROR> E reports = [rep]
INTERNALERROR> E if rep.passed:
INTERNALERROR> E if item.config.getoption("setupshow", False):
INTERNALERROR> E show_test_item(item)
INTERNALERROR> E if not item.config.getoption("setuponly", False):
INTERNALERROR> E > reports.append(call_and_report(item, "call", log))
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/_pytest/runner.py:133:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E item = <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>, when = 'call'
INTERNALERROR> E log = True, kwds = {}
INTERNALERROR> E call = <CallInfo when='call' excinfo=<ExceptionInfo Exception("Failed to create venv.\nError: Command '['/tmp/tmp_uvwwx1i/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.\n") tblen=14>>
INTERNALERROR> E hook = <_pytest.config.compat.PathAwareHookProxy object at 0x7fae4647cb80>
INTERNALERROR> E
INTERNALERROR> E def call_and_report(
INTERNALERROR> E item: Item, when: "Literal['setup', 'call', 'teardown']", log: bool = True, **kwds
INTERNALERROR> E ) -> TestReport:
INTERNALERROR> E call = call_runtest_hook(item, when, **kwds)
INTERNALERROR> E hook = item.ihook
INTERNALERROR> E > report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/_pytest/runner.py:224:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E self = <_HookCaller 'pytest_runtest_makereport'>, args = ()
INTERNALERROR> E kwargs = {'call': <CallInfo when='call' excinfo=<ExceptionInfo Exception("Failed to create venv.\nError: Command '['/tmp/tmp_uv...']' returned non-zero exit status 1.\n") tblen=14>>, 'item': <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>}
INTERNALERROR> E argname = 'call', firstresult = True
INTERNALERROR> E
INTERNALERROR> E def __call__(self, *args, **kwargs):
INTERNALERROR> E if args:
INTERNALERROR> E raise TypeError("hook calling supports only keyword arguments")
INTERNALERROR> E assert not self.is_historic()
INTERNALERROR> E
INTERNALERROR> E # This is written to avoid expensive operations when not needed.
INTERNALERROR> E if self.spec:
INTERNALERROR> E for argname in self.spec.argnames:
INTERNALERROR> E if argname not in kwargs:
INTERNALERROR> E notincall = tuple(set(self.spec.argnames) - kwargs.keys())
INTERNALERROR> E warnings.warn(
INTERNALERROR> E "Argument(s) {} which are declared in the hookspec "
INTERNALERROR> E "can not be found in this hook call".format(notincall),
INTERNALERROR> E stacklevel=2,
INTERNALERROR> E )
INTERNALERROR> E break
INTERNALERROR> E
INTERNALERROR> E firstresult = self.spec.opts.get("firstresult")
INTERNALERROR> E else:
INTERNALERROR> E firstresult = False
INTERNALERROR> E
INTERNALERROR> E > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/pluggy/_hooks.py:265:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E self = <_pytest.config.PytestPluginManager object at 0x7fae47b7ebb0>
INTERNALERROR> E hook_name = 'pytest_runtest_makereport'
INTERNALERROR> E methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/usr/lib/python3.8/site-packages/_pytest/runner...Impl plugin_name='tmpdir', plugin=<module '_pytest.tmpdir' from '/usr/lib/python3.8/site-packages/_pytest/tmpdir.py'>>]
INTERNALERROR> E kwargs = {'call': <CallInfo when='call' excinfo=<ExceptionInfo Exception("Failed to create venv.\nError: Command '['/tmp/tmp_uv...']' returned non-zero exit status 1.\n") tblen=14>>, 'item': <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>}
INTERNALERROR> E firstresult = True
INTERNALERROR> E
INTERNALERROR> E def _hookexec(self, hook_name, methods, kwargs, firstresult):
INTERNALERROR> E # called from all hookcaller instances.
INTERNALERROR> E # enable_tracing will set its own wrapping function at self._inner_hookexec
INTERNALERROR> E > return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/pluggy/_manager.py:80:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E item = <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>
INTERNALERROR> E call = <CallInfo when='call' excinfo=<ExceptionInfo Exception("Failed to create venv.\nError: Command '['/tmp/tmp_uvwwx1i/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.\n") tblen=14>>
INTERNALERROR> E
INTERNALERROR> E @hookimpl(hookwrapper=True)
INTERNALERROR> E def pytest_runtest_makereport(item: Item, call: CallInfo[None]):
INTERNALERROR> E outcome = yield
INTERNALERROR> E > rep = outcome.get_result()
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/_pytest/skipping.py:266:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E item = <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>
INTERNALERROR> E call = <CallInfo when='call' excinfo=<ExceptionInfo Exception("Failed to create venv.\nError: Command '['/tmp/tmp_uvwwx1i/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.\n") tblen=14>>
INTERNALERROR> E
INTERNALERROR> E def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> TestReport:
INTERNALERROR> E > return TestReport.from_item_and_call(item, call)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/_pytest/runner.py:368:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E cls = <class '_pytest.reports.TestReport'>
INTERNALERROR> E item = <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>
INTERNALERROR> E call = <CallInfo when='call' excinfo=<ExceptionInfo Exception("Failed to create venv.\nError: Command '['/tmp/tmp_uvwwx1i/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.\n") tblen=14>>
INTERNALERROR> E
INTERNALERROR> E @classmethod
INTERNALERROR> E def from_item_and_call(cls, item: Item, call: "CallInfo[None]") -> "TestReport":
INTERNALERROR> E """Create and fill a TestReport with standard item and call info.
INTERNALERROR> E
INTERNALERROR> E :param item: The item.
INTERNALERROR> E :param call: The call info.
INTERNALERROR> E """
INTERNALERROR> E when = call.when
INTERNALERROR> E # Remove "collect" from the Literal type -- only for collection calls.
INTERNALERROR> E assert when != "collect"
INTERNALERROR> E duration = call.duration
INTERNALERROR> E start = call.start
INTERNALERROR> E stop = call.stop
INTERNALERROR> E keywords = {x: 1 for x in item.keywords}
INTERNALERROR> E excinfo = call.excinfo
INTERNALERROR> E sections = []
INTERNALERROR> E if not call.excinfo:
INTERNALERROR> E outcome: Literal["passed", "failed", "skipped"] = "passed"
INTERNALERROR> E longrepr: Union[
INTERNALERROR> E None,
INTERNALERROR> E ExceptionInfo[BaseException],
INTERNALERROR> E Tuple[str, int, str],
INTERNALERROR> E str,
INTERNALERROR> E TerminalRepr,
INTERNALERROR> E ] = None
INTERNALERROR> E else:
INTERNALERROR> E if not isinstance(excinfo, ExceptionInfo):
INTERNALERROR> E outcome = "failed"
INTERNALERROR> E longrepr = excinfo
INTERNALERROR> E elif isinstance(excinfo.value, skip.Exception):
INTERNALERROR> E outcome = "skipped"
INTERNALERROR> E r = excinfo._getreprcrash()
INTERNALERROR> E assert (
INTERNALERROR> E r is not None
INTERNALERROR> E ), "There should always be a traceback entry for skipping a test."
INTERNALERROR> E if excinfo.value._use_item_location:
INTERNALERROR> E path, line = item.reportinfo()[:2]
INTERNALERROR> E assert line is not None
INTERNALERROR> E longrepr = os.fspath(path), line + 1, r.message
INTERNALERROR> E else:
INTERNALERROR> E longrepr = (str(r.path), r.lineno, r.message)
INTERNALERROR> E else:
INTERNALERROR> E outcome = "failed"
INTERNALERROR> E if call.when == "call":
INTERNALERROR> E > longrepr = item.repr_failure(excinfo)
INTERNALERROR> E
INTERNALERROR> E /usr/lib/python3.8/site-packages/_pytest/reports.py:362:
INTERNALERROR> E _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> E
INTERNALERROR> E self = <DataDrivenTestCase testTypedPkgNoSitePkgsIgnoredImports>
INTERNALERROR> E excinfo = <ExceptionInfo Exception("Failed to create venv.\nError: Command '['/tmp/tmp_uvwwx1i/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.\n") tblen=14>
INTERNALERROR> E style = None
INTERNALERROR> E
INTERNALERROR> E def repr_failure(self, excinfo: Any, style: Any | None = None) -> str:
INTERNALERROR> E if isinstance(excinfo.value, SystemExit):
INTERNALERROR> E # We assume that before doing exit() (which raises SystemExit) we've printed
INTERNALERROR> E # enough context about what happened so that a stack trace is not useful.
INTERNALERROR> E # In particular, uncaught exceptions during semantic analysis or type checking
INTERNALERROR> E # call exit() and they already print out a stack trace.
INTERNALERROR> E excrepr = excinfo.exconly()
INTERNALERROR> E elif isinstance(excinfo.value, pytest.fail.Exception) and not excinfo.value.pytrace:
INTERNALERROR> E excrepr = excinfo.exconly()
INTERNALERROR> E else:
INTERNALERROR> E > self.parent._prunetraceback(excinfo)
INTERNALERROR> E E AttributeError: 'DataFileCollector' object has no attribute '_prunetraceback'
INTERNALERROR> E
INTERNALERROR> E /home/tkloczko/rpmbuild/BUILD/mypy-1.4.1/mypy/test/data.py:392: AttributeError
INTERNALERROR> E assert False
INTERNALERROR>
INTERNALERROR> /usr/lib/python3.8/site-packages/xdist/dsession.py:197: AssertionError
.INTERNALERROR> config = <_pytest.config.Config object at 0x7f33250c3970>, doit = <function _main at 0x7f332604cc10>
INTERNALERROR>
INTERNALERROR> def wrap_session(
INTERNALERROR> config: Config, doit: Callable[[Config, "Session"], Optional[Union[int, ExitCode]]]
INTERNALERROR> ) -> Union[int, ExitCode]:
INTERNALERROR> """Skeleton command line program."""
INTERNALERROR> session = Session.from_config(config)
INTERNALERROR> session.exitstatus = ExitCode.OK
INTERNALERROR> initstate = 0
INTERNALERROR> try:
INTERNALERROR> try:
INTERNALERROR> config._do_configure()
INTERNALERROR> initstate = 1
INTERNALERROR> config.hook.pytest_sessionstart(session=session)
INTERNALERROR> initstate = 2
INTERNALERROR> > session.exitstatus = doit(config, session) or 0
INTERNALERROR>
INTERNALERROR> /usr/lib/python3.8/site-packages/_pytest/main.py:270:
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR>
INTERNALERROR> config = <_pytest.config.Config object at 0x7f33250c3970>, session = <Session mypy-1.4.1 exitstatus=<ExitCode.INTERNAL_ERROR: 3> testsfailed=0 testscollected=11206>
INTERNALERROR>
INTERNALERROR> def _main(config: Config, session: "Session") -> Optional[Union[int, ExitCode]]:
INTERNALERROR> """Default command line protocol for initialization, session,
INTERNALERROR> running tests and reporting."""
INTERNALERROR> config.hook.pytest_collection(session=session)
INTERNALERROR> > config.hook.pytest_runtestloop(session=session)
INTERNALERROR>
INTERNALERROR> /usr/lib/python3.8/site-packages/_pytest/main.py:324:
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR>
INTERNALERROR> self = <_HookCaller 'pytest_runtestloop'>, args = (), kwargs = {'session': <Session mypy-1.4.1 exitstatus=<ExitCode.INTERNAL_ERROR: 3> testsfailed=0 testscollected=11206>}
INTERNALERROR> argname = 'session', firstresult = True
INTERNALERROR>
INTERNALERROR> def __call__(self, *args, **kwargs):
INTERNALERROR> if args:
INTERNALERROR> raise TypeError("hook calling supports only keyword arguments")
INTERNALERROR> assert not self.is_historic()
INTERNALERROR>
INTERNALERROR> # This is written to avoid expensive operations when not needed.
INTERNALERROR> if self.spec:
INTERNALERROR> for argname in self.spec.argnames:
INTERNALERROR> if argname not in kwargs:
INTERNALERROR> notincall = tuple(set(self.spec.argnames) - kwargs.keys())
INTERNALERROR> warnings.warn(
INTERNALERROR> "Argument(s) {} which are declared in the hookspec "
INTERNALERROR> "can not be found in this hook call".format(notincall),
INTERNALERROR> stacklevel=2,
INTERNALERROR> )
INTERNALERROR> break
INTERNALERROR>
INTERNALERROR> firstresult = self.spec.opts.get("firstresult")
INTERNALERROR> else:
INTERNALERROR> firstresult = False
INTERNALERROR>
INTERNALERROR> > return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>
INTERNALERROR> /usr/lib/python3.8/site-packages/pluggy/_hooks.py:265:
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR>
INTERNALERROR> self = <_pytest.config.PytestPluginManager object at 0x7f33261c2490>, hook_name = 'pytest_runtestloop'
INTERNALERROR> methods = [<HookImpl plugin_name='main', plugin=<module '_pytest.main' from '/usr/lib/python3.8/site-packages/_pytest/main.py'>>...3324b26640>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x7f3324a2f0a0>>]
INTERNALERROR> kwargs = {'session': <Session mypy-1.4.1 exitstatus=<ExitCode.INTERNAL_ERROR: 3> testsfailed=0 testscollected=11206>}, firstresult = True
INTERNALERROR>
INTERNALERROR> def _hookexec(self, hook_name, methods, kwargs, firstresult):
INTERNALERROR> # called from all hookcaller instances.
INTERNALERROR> # enable_tracing will set its own wrapping function at self._inner_hookexec
INTERNALERROR> > return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>
INTERNALERROR> /usr/lib/python3.8/site-packages/pluggy/_manager.py:80:
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR>
INTERNALERROR> self = <xdist.dsession.DSession object at 0x7f3324b26640>
INTERNALERROR>
INTERNALERROR> @pytest.hookimpl
INTERNALERROR> def pytest_runtestloop(self):
INTERNALERROR> self.sched = self.config.hook.pytest_xdist_make_scheduler(
INTERNALERROR> config=self.config, log=self.log
INTERNALERROR> )
INTERNALERROR> assert self.sched is not None
INTERNALERROR>
INTERNALERROR> self.shouldstop = False
INTERNALERROR> while not self.session_finished:
INTERNALERROR> > self.loop_once()
INTERNALERROR>
INTERNALERROR> /usr/lib/python3.8/site-packages/xdist/dsession.py:122:
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR>
INTERNALERROR> self = <xdist.dsession.DSession object at 0x7f3324b26640>
INTERNALERROR>
INTERNALERROR> def loop_once(self):
INTERNALERROR> """Process one callback from one of the workers."""
INTERNALERROR> while 1:
INTERNALERROR> if not self._active_nodes:
INTERNALERROR> # If everything has died stop looping
INTERNALERROR> self.triggershutdown()
INTERNALERROR> raise RuntimeError("Unexpectedly no active workers available")
INTERNALERROR> try:
INTERNALERROR> eventcall = self.queue.get(timeout=2.0)
INTERNALERROR> break
INTERNALERROR> except Empty:
INTERNALERROR> continue
INTERNALERROR> callname, kwargs = eventcall
INTERNALERROR> assert callname, kwargs
INTERNALERROR> method = "worker_" + callname
INTERNALERROR> call = getattr(self, method)
INTERNALERROR> self.log("calling method", method, kwargs)
INTERNALERROR> > call(**kwargs)
INTERNALERROR>
INTERNALERROR> /usr/lib/python3.8/site-packages/xdist/dsession.py:145:
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR>
INTERNALERROR> self = <xdist.dsession.DSession object at 0x7f3324b26640>, node = <WorkerController gw4>
INTERNALERROR>
INTERNALERROR> def worker_workerfinished(self, node):
INTERNALERROR> """Emitted when node executes its pytest_sessionfinish hook.
INTERNALERROR>
INTERNALERROR> Removes the node from the scheduler.
INTERNALERROR>
INTERNALERROR> The node might not be in the scheduler if it had not emitted
INTERNALERROR> workerready before shutdown was triggered.
INTERNALERROR> """
INTERNALERROR> self.config.hook.pytest_testnodedown(node=node, error=None)
INTERNALERROR> if node.workeroutput["exitstatus"] == 2: # keyboard-interrupt
INTERNALERROR> self.shouldstop = f"{node} received keyboard-interrupt"
INTERNALERROR> self.worker_errordown(node, "keyboard-interrupt")
INTERNALERROR> return
INTERNALERROR> if node in self.sched.nodes:
INTERNALERROR> crashitem = self.sched.remove_node(node)
INTERNALERROR> > assert not crashitem, (crashitem, node)
INTERNALERROR> E AssertionError: ('mypy/test/testpep561.py::PEP561Suite::pep561.test::testTypedPkgNoSitePkgsIgnoredImports', <WorkerController gw4>)
INTERNALERROR> E assert not 'mypy/test/testpep561.py::PEP561Suite::pep561.test::testTypedPkgNoSitePkgsIgnoredImports'
INTERNALERROR>
INTERNALERROR> /usr/lib/python3.8/site-packages/xdist/dsession.py:184: AssertionError PS. Maybe it would be good to add to issue ticket template note about provide |
mypy is using private pytest APIs which were removed in fcada1e. This was already fixed here: python/mypy#15611 |
Thank you 👍 😄 |
pip list
from the virtual environment you are usingI'm packaging
mypy
as the rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulescut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
Here is list of installed modules in build env
The text was updated successfully, but these errors were encountered: