diff options
| author | Brianna Rainey | 2026-01-29 14:50:29 -0500 |
|---|---|---|
| committer | GitHub | 2026-01-29 14:50:29 -0500 |
| commit | 71a22c6a121d1294a05ef35020c525fa70cae2fd (patch) | |
| tree | 025dd2329c214a5fe5ac78c7f2e8342e2bfde14d /tests/test_comp_image.py | |
| parent | f66eb99465c61232a7f649e66bee59504bb0e52c (diff) | |
v2.2.2 - fix flaky tests, fix UnboundLocalError in MainWindow.createNewProject (#94)
* search more than one filename for compName
* remove extra QVBoxLayout
* insert default components using name instead of index
* bump version 2.2.1 to 2.2.2
* tests do not use `.config` for settings
Core.storeSettings() is no longer called as a side effect any time avp.core is imported. Thus the tests use a new `initCore` method and the normal user path now relies on entering via `cli.py`. This means certain toolkit functions (e.g., ones using `FFMPEG_BIN`) no longer work if imported from a different python script, unless they call Core.storeSettings() themselves to initialize the settings.ini file
* fix UnboundLocalError in createNewProject
Diffstat (limited to 'tests/test_comp_image.py')
| -rw-r--r-- | tests/test_comp_image.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/test_comp_image.py b/tests/test_comp_image.py index a4f05e1..c580d5a 100644 --- a/tests/test_comp_image.py +++ b/tests/test_comp_image.py @@ -1,16 +1,15 @@ from avp.command import Command from pytestqt import qtbot from pytest import fixture -from . import audioData, MockSignal, imageDataSum, getTestDataPath +from . import audioData, command, MockSignal, imageDataSum, getTestDataPath sampleSize = 1470 # 44100 / 30 = 1470 @fixture -def coreWithImageComp(qtbot): +def coreWithImageComp(qtbot, command): """Fixture providing a Command object with Image component added""" - command = Command() command.settings.setValue("outputHeight", 1080) command.settings.setValue("outputWidth", 1920) command.core.insertComponent(0, command.core.moduleIndexFor("Image"), command) @@ -20,7 +19,7 @@ def coreWithImageComp(qtbot): def test_comp_image_set_path(coreWithImageComp): "Set imagePath of Image component" comp = coreWithImageComp.selectedComponents[0] - comp.imagePath = getTestDataPath("test.jpg") + comp.imagePath = getTestDataPath("inputfiles/test.jpg") image = comp.previewRender() assert imageDataSum(image) == 463711601 @@ -28,7 +27,7 @@ def test_comp_image_set_path(coreWithImageComp): def test_comp_image_scale_50_1080p(coreWithImageComp): """Image component stretches image to 50% at 1080p""" comp = coreWithImageComp.selectedComponents[0] - comp.imagePath = getTestDataPath("test.jpg") + comp.imagePath = getTestDataPath("inputfiles/test.jpg") image = comp.previewRender() sum = imageDataSum(image) comp.page.spinBox_scale.setValue(50) @@ -38,7 +37,7 @@ def test_comp_image_scale_50_1080p(coreWithImageComp): def test_comp_image_scale_50_720p(coreWithImageComp): """Image component stretches image to 50% at 720p""" comp = coreWithImageComp.selectedComponents[0] - comp.imagePath = getTestDataPath("test.jpg") + comp.imagePath = getTestDataPath("inputfiles/test.jpg") comp.page.spinBox_scale.setValue(50) image = comp.previewRender() sum = imageDataSum(image) |
