π π A Python library for audio.
C audioaudio-processingaudio-productionaudio-researchaudio-unitaugmentationjucemachine-learningpybind11pythonvst3vst3-host
Add test for show_editor.
Peter Sobot53014a7bbeeb
diff --git a/test-requirements.txt b/test-requirements.txtindex 8dcc0fd..53a785b 100644--- a/test-requirements.txt+++ b/test-requirements.txt@@ -14,3 +14,4 @@ soxtensorflow~=2.6.2; python_version < '3.10' and platform.machine != 'arm64'google-cloud-storagetqdm+psutildiff --git a/tests/test_external_plugins.py b/tests/test_external_plugins.pyindex 4b5f66a..79e94a1 100644--- a/tests/test_external_plugins.py+++ b/tests/test_external_plugins.py@@ -18,10 +18,12 @@import osimport timeimport math+import psutilimport atexitimport randomimport shutilimport platform+import subprocessfrom glob import globfrom pathlib import Path@@ -648,3 +650,22 @@ def test_external_plugin_latency_compensation(buffer_size: int, oversampling: inoutput = plugin.process(noise, sample_rate, buffer_size=buffer_size)np.testing.assert_allclose(output, noise, atol=0.05)++[email protected]("plugin_filename", AVAILABLE_PLUGINS_IN_TEST_ENVIRONMENT)+def test_show_editor(plugin_filename: str):+ # Run this test in a subprocess, as otherwise we'd block this thread:+ full_plugin_filename = os.path.join(TEST_PLUGIN_BASE_PATH, platform.system(), plugin_filename)+ try:+ subprocess.check_call(+ [+ psutil.Process(os.getpid()).exe(),+ "-c",+ "import pedalboard;"+ f" pedalboard.load_plugin(\"{full_plugin_filename}\").show_editor()",+ ],+ timeout=5,+ )+ except subprocess.TimeoutExpired:+ # This is good: the UI was shown, no issues.+ pass