Package: ipykernel
Version: 6.29.3-1
Followup-For: Bug #1070112
X-Debbugs-Cc: chris.peter...@canonical.com
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu oracular ubuntu-patch
Control: tags -1 patch



Hi,

I applied the following patch in Ubuntu to fix this issue.

  * pytest8-nose-deprecation.patch: update tests for pytest 8 compatibility
    (LP: #2068672).


Thanks for considering the patch.


-- System Information:
Debian Release: trixie/sid
  APT prefers oracular
  APT policy: (500, 'oracular'), (100, 'oracular-proposed')
Architecture: amd64 (x86_64)

Kernel: Linux 6.8.0-31-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru ipykernel-6.29.3/debian/patches/pytest8-nose-deprecation.patch 
ipykernel-6.29.3/debian/patches/pytest8-nose-deprecation.patch
--- ipykernel-6.29.3/debian/patches/pytest8-nose-deprecation.patch      
1969-12-31 16:00:00.000000000 -0800
+++ ipykernel-6.29.3/debian/patches/pytest8-nose-deprecation.patch      
2024-06-06 16:39:16.000000000 -0700
@@ -0,0 +1,95 @@
+Description: Update tests for pytest 8 compatibility
+ Pytest 8 deprecated support for nose-style tests. This patch cherrry-picks
+ changes from upstream to modify tests to run with pytest 8.
+Author: Chris Peterson <chris.peter...@canonical.com>
+Origin: upstream, 
https://github.com/ipython/ipykernel/commit/a7d66ae2197e0d7471ba160542cf5ff7713084b5
+Bug: https://github.com/ipython/ipykernel/issues/1230
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ipykernel/+bug/2068672
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1070112
+Forwarded: not-needed
+Last-Update: 2024-06-06
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/tests/__init__.py
++++ b/tests/__init__.py
+@@ -7,6 +7,8 @@
+ import tempfile
+ from unittest.mock import patch
+ 
++import pytest
++
+ from ipykernel.kernelspec import install
+ 
+ pjoin = os.path.join
+@@ -15,7 +17,8 @@
+ patchers: list = []
+ 
+ 
+-def setup():
++@pytest.fixture(autouse=True)
++def _global_setup():
+     """setup temporary env for tests"""
+     global tmp
+     tmp = tempfile.mkdtemp()
+@@ -35,8 +38,8 @@
+     # install IPython in the temp home:
+     install(user=True)
+ 
++    yield
+ 
+-def teardown():
+     for p in patchers:
+         p.stop()
+ 
+--- a/tests/test_eventloop.py
++++ b/tests/test_eventloop.py
+@@ -42,14 +42,15 @@
+ _get_qt_vers()
+ 
+ 
+-def setup():
++@pytest.fixture(autouse=True)
++def _setup_env():
+     """start the global kernel (if it isn't running) and return its client"""
+     global KM, KC
+     KM, KC = start_new_kernel()
+     flush_channels(KC)
+ 
++    yield
+ 
+-def teardown():
+     assert KM is not None
+     assert KC is not None
+     KC.stop_channels()
+--- a/tests/test_message_spec.py
++++ b/tests/test_message_spec.py
+@@ -21,7 +21,8 @@
+ KC: BlockingKernelClient = None  # type:ignore
+ 
+ 
+-def setup():
++@pytest.fixture(autouse=True)
++def _setup_env():
+     global KC
+     KC = start_global_kernel()
+ 
+--- a/tests/test_async.py
++++ b/tests/test_async.py
+@@ -8,14 +8,15 @@
+ KC = KM = None
+ 
+ 
+-def setup_function():
++@pytest.fixture(autouse=True)
++def _setup_env():
+     """start the global kernel (if it isn't running) and return its client"""
+     global KM, KC
+     KM, KC = start_new_kernel()
+     flush_channels(KC)
+ 
++    yield
+ 
+-def teardown_function():
+     assert KC is not None
+     assert KM is not None
+     KC.stop_channels()
diff -Nru ipykernel-6.29.3/debian/patches/series 
ipykernel-6.29.3/debian/patches/series
--- ipykernel-6.29.3/debian/patches/series      2024-01-11 14:25:38.000000000 
-0800
+++ ipykernel-6.29.3/debian/patches/series      2024-06-06 16:22:48.000000000 
-0700
@@ -1,2 +1,3 @@
 0002-test_simple_print-may-produce-stderr-content-when-ex.patch
 0003-Made-build-reproducible-patch-by-Daniel-Shahaf.patch
+pytest8-nose-deprecation.patch

Reply via email to