Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Test skipped on Linux

未关闭
#503 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
testing-qa

调研方向

从 ipykernel/tests/test_kernel.py 和 test_complete 函数开始,然后在 Linux 上重现该失败。通过 traceback 中的 IPython/core/completer.py 路径以及 Jedi 的参数描述格式,追踪补全请求;完成的标准是该测试不再需要跳过,并且能在没有 ValueError 的情况下收到补全响应。

由索引模型根据 Issue 内容生成。

描述

The test_complete function was failing on Travis in master with:

    def test_complete():

        with kernel() as kc:

            execute(u'a = 1', kc=kc)

            wait_for_idle(kc)

            cell = 'import IPython\nb = a.'

            kc.complete(cell)

>           reply = kc.get_shell_msg(block=True, timeout=TIMEOUT)

ipykernel/tests/test_kernel.py:265: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

../../../virtualenv/python3.6.7/lib/python3.6/site-packages/jupyter_client/client.py:78: in get_shell_msg

    return self.shell_channel.get_msg(*args, **kwargs)

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <jupyter_client.blocking.channels.ZMQSocketChannel object at 0x7f3c1ededb70>

block = True, timeout = 15000

    def get_msg(self, block=True, timeout=None):

        """ Gets a message if there is one that is ready. """

        if block:

            if timeout is not None:

                timeout *= 1000  # seconds to ms

            ready = self.socket.poll(timeout)

        else:

            ready = self.socket.poll(timeout=0)

    

        if ready:

            return self._recv()

        else:

>           raise Empty

E           queue.Empty

../../../virtualenv/python3.6.7/lib/python3.6/site-packages/jupyter_client/blocking/channels.py:57: Empty
----------------------------- Captured stdout call -----------------------------

[IPKernelApp] ERROR | Exception in message handler:

Traceback (most recent call last):

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 268, in dispatch_shell

    yield gen.maybe_future(handler(stream, idents, msg))

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tornado/gen.py", line 735, in run

    value = future.result()

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tornado/gen.py", line 209, in wrapper

    yielded = next(result)

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 583, in complete_request

    matches = yield gen.maybe_future(self.do_complete(code, cursor_pos))

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/ipykernel/ipkernel.py", line 354, in do_complete

    return self._experimental_do_complete(code, cursor_pos)

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/ipykernel/ipkernel.py", line 379, in _experimental_do_complete

    completions = list(_rectify_completions(code, raw_completions))

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/completer.py", line 484, in rectify_completions

    completions = list(completions)

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/completer.py", line 1820, in completions

    for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000):

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/completer.py", line 1877, in _completions

    signature = _make_signature(jm)

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/completer.py", line 991, in _make_signature

    return '(%s)'% ', '.join([f for f in (_formatparamchildren(p) for signature in completion.get_signatures()

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/completer.py", line 991, in <listcomp>

    return '(%s)'% ', '.join([f for f in (_formatparamchildren(p) for signature in completion.get_signatures()

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/completer.py", line 992, in <genexpr>

    for p in signature.defined_names()) if f])

  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/completer.py", line 969, in _formatparamchildren

    'Expected "param ...", found %r".' % description)

ValueError: Jedi function parameter description have change format.Expected "param ...", found 'def __sizeof__'".

We are skipping the test on Linux in #500 because we couldn't find a way to fix the test.

主要语言
Python
星标
734
派生
411
平均合并
1 天 2 小时
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ipython/ipykernel 的其他 Issue

查看 ipython/ipykernel 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。