Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-PyAudio for openSUSE:Factory 
checked in at 2022-02-07 23:38:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-PyAudio (Old)
 and      /work/SRC/openSUSE:Factory/.python-PyAudio.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-PyAudio"

Mon Feb  7 23:38:23 2022 rev:4 rq:952141 version:0.2.11

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-PyAudio/python-PyAudio.changes    
2019-11-13 13:14:40.470844858 +0100
+++ /work/SRC/openSUSE:Factory/.python-PyAudio.new.1898/python-PyAudio.changes  
2022-02-07 23:39:56.773682551 +0100
@@ -1,0 +2,7 @@
+Mon Feb  7 14:14:04 UTC 2022 - Matej Cepl <mc...@suse.com>
+
+- Add loopback_required.patch which allows skipping over tests
+  requiring special hardware without pytest. The issue reported
+  upstream by email.
+
+-------------------------------------------------------------------

New:
----
  loopback_required.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-PyAudio.spec ++++++
--- /var/tmp/diff_new_pack.mNrvuA/_old  2022-02-07 23:39:57.157679923 +0100
+++ /var/tmp/diff_new_pack.mNrvuA/_new  2022-02-07 23:39:57.161679896 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-PyAudio
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%bcond_with     test
+%bcond_without  test
 Name:           python-PyAudio
 Version:        0.2.11
 Release:        0
@@ -25,13 +25,15 @@
 License:        MIT
 URL:            https://people.csail.mit.edu/hubert/pyaudio/
 Source:         
https://files.pythonhosted.org/packages/source/P/PyAudio/PyAudio-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM loopback_required.patch mc...@suse.com
+# Mark tests requiring specific hardware as such
+Patch0:         loopback_required.patch
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  portaudio-devel
 BuildRequires:  python-rpm-macros
 %if %{with test}
-BuildRequires:  %{python_module nose}
 BuildRequires:  %{python_module numpy}
 BuildRequires:  alsa
 %endif
@@ -44,6 +46,7 @@
 
 %prep
 %setup -q -n PyAudio-%{version}
+%autopatch -p1
 
 %build
 export CFLAGS="%{optflags} -fno-strict-aliasing"
@@ -55,11 +58,9 @@
 
 %if %{with test}
 %check
-pushd tests
-%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch}
-$python -B -m nose ./*.py
-}
-popd
+# report send to hub...@mit.edu
+export HW_REQUIRED=1
+%pyunittest_arch discover -p '*.py' -v -s tests
 %endif
 
 %files %{python_files}

++++++ loopback_required.patch ++++++
---
 tests/__init__.py      |    3 +++
 tests/error_tests.py   |    5 +++++
 tests/pyaudio_tests.py |   11 +++++++++++
 3 files changed, 19 insertions(+)

--- /dev/null
+++ b/tests/__init__.py
@@ -0,0 +1,3 @@
+import os
+
+HARDWARE = 'HW_REQUIRED' in os.environ
--- a/tests/error_tests.py
+++ b/tests/error_tests.py
@@ -3,6 +3,7 @@ import time
 import unittest
 
 import pyaudio
+from tests import HARDWARE
 
 class PyAudioErrorTests(unittest.TestCase):
     def setUp(self):
@@ -55,6 +56,7 @@ class PyAudioErrorTests(unittest.TestCas
                                  input=True)
             stream.write('foo')
 
+    @unittest.skipIf(HARDWARE, 'Loopback hardware required.')
     def test_error_negative_frames(self):
         with self.assertRaises(ValueError):
             stream = self.p.open(channels=1,
@@ -63,6 +65,7 @@ class PyAudioErrorTests(unittest.TestCas
                                  input=True)
             stream.read(-1)
 
+    @unittest.skipIf(HARDWARE, 'Loopback hardware required.')
     def test_invalid_attr_on_closed_stream(self):
         stream = self.p.open(channels=1,
                              rate=44100,
@@ -81,6 +84,7 @@ class PyAudioErrorTests(unittest.TestCas
         with self.assertRaises(ValueError):
             self.p.is_format_supported(8000, 0, -1, pyaudio.paInt16)
 
+    @unittest.skipIf(HARDWARE, 'Loopback hardware required.')
     def test_write_underflow_exception(self):
         stream = self.p.open(channels=1,
                              rate=44100,
@@ -100,6 +104,7 @@ class PyAudioErrorTests(unittest.TestCas
         self.assertEqual(err.exception.errno, pyaudio.paOutputUnderflowed)
         self.assertEqual(err.exception.strerror, 'Output underflowed')
 
+    @unittest.skipIf(HARDWARE, 'Loopback hardware required.')
     def test_read_overflow_exception(self):
         stream = self.p.open(channels=1,
                              rate=44100,
--- a/tests/pyaudio_tests.py
+++ b/tests/pyaudio_tests.py
@@ -22,6 +22,7 @@ import sys
 import numpy
 
 import pyaudio
+from tests import HARDWARE
 
 DUMP_CAPTURE=False
 
@@ -71,6 +72,7 @@ class PyAudioTests(unittest.TestCase):
 
         return input_idx, output_idx
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_system_info(self):
         """Basic system info tests"""
         self.assertTrue(self.p.get_host_api_count() > 0)
@@ -78,6 +80,7 @@ class PyAudioTests(unittest.TestCase):
         api_info = self.p.get_host_api_info_by_index(0)
         self.assertTrue(len(api_info.items()) > 0)
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_input_output_blocking(self):
         """Test blocking-based record and playback."""
         rate = 44100 # frames per second
@@ -138,6 +141,7 @@ class PyAudioTests(unittest.TestCase):
             test_signal,
             len(freqs))
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_input_output_callback(self):
         """Test callback-based record and playback."""
         rate = 44100 # frames per second
@@ -207,6 +211,7 @@ class PyAudioTests(unittest.TestCase):
             test_signal,
             len(freqs))
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_device_lock_gil_order(self):
         """Ensure no deadlock between Pa_{Open,Start,Stop}Stream and GIL."""
         # This test targets OSX/macOS CoreAudio, which seems to use
@@ -262,6 +267,7 @@ class PyAudioTests(unittest.TestCase):
         in_stream.stop_stream()
         out_stream.stop_stream()
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_stream_state_gil(self):
         """Ensure no deadlock between Pa_IsStream{Active,Stopped} and GIL."""
         rate = 44100 # frames per second
@@ -322,6 +328,7 @@ class PyAudioTests(unittest.TestCase):
         in_stream.stop_stream()
         out_stream.stop_stream()
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_get_stream_time_gil(self):
         """Ensure no deadlock between PA_GetStreamTime and GIL."""
         rate = 44100 # frames per second
@@ -376,6 +383,7 @@ class PyAudioTests(unittest.TestCase):
         in_stream.stop_stream()
         out_stream.stop_stream()
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_get_stream_cpuload_gil(self):
         """Ensure no deadlock between Pa_GetStreamCpuLoad and GIL."""
         rate = 44100 # frames per second
@@ -430,6 +438,7 @@ class PyAudioTests(unittest.TestCase):
         in_stream.stop_stream()
         out_stream.stop_stream()
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_get_stream_write_available_gil(self):
         """Ensure no deadlock between Pa_GetStreamWriteAvailable and GIL."""
         rate = 44100 # frames per second
@@ -477,6 +486,7 @@ class PyAudioTests(unittest.TestCase):
         time.sleep(0.1)
         in_stream.stop_stream()
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_get_stream_read_available_gil(self):
         """Ensure no deadlock between Pa_GetStreamReadAvailable and GIL."""
         rate = 44100 # frames per second
@@ -524,6 +534,7 @@ class PyAudioTests(unittest.TestCase):
         time.sleep(0.1)
         in_stream.stop_stream()
 
+    @unittest.skipIf(HARDWARE, 'Loopback device required.')
     def test_terminate_gil(self):
         """Ensure no deadlock between Pa_Terminate and GIL."""
         rate = 44100 # frames per second

Reply via email to