ipython / ipython/ipykernel

6.5.1: pytest is failing in one unit (only)

Abierto
#806 3 comentarios 0 reacciones 0 asignados Ver en GitHub
question
Lenguaje dominante
Python
Estrellas
734
Forks
412
Merge medio
1 d 5 h
PR fusionados (30 d)
8

Descripción

I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.
- "setup.py build"
- "setup.py install --root "
- "pytest with PYTHONPATH pointing to sitearch and sitelib inside

Looks like after some changes in `ipykernel` only one unit is now failing:
```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-ipykernel-6.5.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-ipykernel-6.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/ipykernel-6.5.1
plugins: shutil-1.7.0, virtualenv-1.7.0, mock-3.6.1, hypothesis-6.14.6, cov-2.12.1, asyncio-0.15.1, anyio-3.3.4, forked-1.3.0, xdist-2.3.0, flaky-3.7.0
collected 105 items / 1 skipped / 104 selected

ipykernel/inprocess/tests/test_kernel.py s.s.. [ 4%]
ipykernel/inprocess/tests/test_kernelmanager.py ..... [ 9%]
ipykernel/tests/test_async.py ...s [ 13%]
ipykernel/tests/test_connect.py ..... [ 18%]
ipykernel/tests/test_embed_kernel.py ... [ 20%]
ipykernel/tests/test_eventloop.py . [ 21%]
ipykernel/tests/test_heartbeat.py .... [ 25%]
ipykernel/tests/test_io.py .. [ 27%]
ipykernel/tests/test_jsonutil.py sssss [ 32%]
ipykernel/tests/test_kernel.py .ss........F.ss.s..... [ 53%]
ipykernel/tests/test_kernelspec.py ............. [ 65%]
ipykernel/tests/test_message_spec.py ....................... [ 87%]
ipykernel/tests/test_pickleutil.py ..... [ 92%]
ipykernel/tests/test_start_kernel.py .. [ 94%]
ipykernel/tests/test_zmq_shell.py ...... [100%]

================================================================================= FAILURES =================================================================================
_____________________________________________________________________________ test_help_output _____________________________________________________________________________

def test_help_output():
"""ipython kernel --help-all works"""
> tt.help_all_output_test('kernel')

ipykernel/tests/test_kernel.py:245:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

subcommand = 'kernel'

def help_all_output_test(subcommand=''):
"""test that `ipython [subcommand] --help-all` works"""
cmd = get_ipython_cmd() + [subcommand, '--help-all']
out, err, rc = get_output_error_code(cmd)
> nt.assert_equal(rc, 0, err)
E NameError: name 'nt' is not defined

/usr/lib/python3.8/site-packages/IPython/testing/tools.py:466: NameError
============================================================================= warnings summary =============================================================================
ipykernel/tests/test_pickleutil.py:4
/home/tkloczko/rpmbuild/BUILD/ipykernel-6.5.1/ipykernel/tests/test_pickleutil.py:4: DeprecationWarning: ipykernel.pickleutil is deprecated. It has moved to ipyparallel.
from ipykernel.pickleutil import can, uncan

ipykernel/inprocess/tests/test_kernel.py::InProcessKernelTestCase::test_getpass_stream
/home/tkloczko/rpmbuild/BUILD/ipykernel-6.5.1/ipykernel/inprocess/tests/test_kernel.py:126: UserWarning: The `stream` parameter of `getpass.getpass` will have no effect when using ipykernel
kernel.getpass(stream='non empty')

ipykernel/tests/test_message_spec.py::test_execute
/home/tkloczko/rpmbuild/BUILD/ipykernel-6.5.1/ipykernel/tests/test_message_spec.py:99: DeprecationWarning: ExecuteResult._data_changed is deprecated in traitlets 4.1: use @observe and @unobserve instead.
def _data_changed(self, name, old, new):

-- Docs: https://docs.pytest.org/en/stable/warnings.html
===Flaky Test Report===

test_embed_kernel_basic passed 1 out of the required 1 times. Success!
test_embed_kernel_namespace passed 1 out of the required 1 times. Success!
test_embed_kernel_reentrant passed 1 out of the required 1 times. Success!
test_subprocess_print passed 1 out of the required 1 times. Success!
test_subprocess_noprint passed 1 out of the required 1 times. Success!
test_subprocess_error passed 1 out of the required 1 times. Success!
test_ipython_start_kernel_userns passed 1 out of the required 1 times. Success!
test_ipython_start_kernel_no_userns passed 1 out of the required 1 times. Success!

===End Flaky Test Report===
========================================================================= short test summary info ==========================================================================
SKIPPED [1] ipykernel/tests/test_debugger.py:8: could not import 'debugpy': No module named 'debugpy'
SKIPPED [1] ipykernel/inprocess/tests/test_kernel.py:102: Currently don't capture during test as pytest does its own capturing
SKIPPED [1] ipykernel/inprocess/tests/test_kernel.py:65: This test requires matplotlib
SKIPPED [1] ipykernel/tests/test_async.py:48: Requires curio
SKIPPED [1] ipykernel/tests/test_jsonutil.py:35: json_clean is a no-op
SKIPPED [1] ipykernel/tests/test_jsonutil.py:69: json_clean is a no-op
SKIPPED [1] ipykernel/tests/test_jsonutil.py:95: json_clean is a no-op
SKIPPED [1] ipykernel/tests/test_jsonutil.py:101: json_clean is a no-op
SKIPPED [1] ipykernel/tests/test_jsonutil.py:111: json_clean is a no-op
SKIPPED [1] ipykernel/tests/test_kernel.py:53: Currently don't capture during test as pytest does its own capturing
SKIPPED [1] ipykernel/tests/test_kernel.py:67: Currently don't capture during test as pytest does its own capturing
SKIPPED [1] ipykernel/tests/test_kernel.py:272: only run on Windows
SKIPPED [1] ipykernel/tests/test_kernel.py:300: this test requires matplotlib
SKIPPED [1] ipykernel/tests/test_kernel.py:334: test only on windows
FAILED ipykernel/tests/test_kernel.py::test_help_output - NameError: name 'nt' is not defined
===================================================== 1 failed, 91 passed, 14 skipped, 3 warnings in 60.19s (0:01:00) ======================================================
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.