Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Maliku:python
python-PyAudio
loopback_required.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File loopback_required.patch of Package python-PyAudio
--- 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
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor