aboutsummaryrefslogtreecommitdiff
path: root/tests/test_commandline_parser.py
diff options
context:
space:
mode:
authorBrianna Rainey2026-01-29 14:50:29 -0500
committerGitHub2026-01-29 14:50:29 -0500
commit71a22c6a121d1294a05ef35020c525fa70cae2fd (patch)
tree025dd2329c214a5fe5ac78c7f2e8342e2bfde14d /tests/test_commandline_parser.py
parentf66eb99465c61232a7f649e66bee59504bb0e52c (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_commandline_parser.py')
-rw-r--r--tests/test_commandline_parser.py26
1 files changed, 9 insertions, 17 deletions
diff --git a/tests/test_commandline_parser.py b/tests/test_commandline_parser.py
index 77836ce..186c602 100644
--- a/tests/test_commandline_parser.py
+++ b/tests/test_commandline_parser.py
@@ -1,39 +1,34 @@
import sys
import pytest
-from avp.command import Command
from pytestqt import qtbot
+from . import command
-def test_commandline_help(qtbot):
- command = Command()
+def test_commandline_help(qtbot, command):
sys.argv = ["", "--help"]
with pytest.raises(SystemExit):
command.parseArgs()
-def test_commandline_help_if_bad_args(qtbot):
- command = Command()
+def test_commandline_help_if_bad_args(qtbot, command):
sys.argv = ["", "--junk"]
with pytest.raises(SystemExit):
command.parseArgs()
-def test_commandline_launches_gui_if_verbose(qtbot):
- command = Command()
+def test_commandline_launches_gui_if_verbose(qtbot, command):
sys.argv = ["", "--verbose"]
mode = command.parseArgs()
assert mode == "GUI"
-def test_commandline_launches_gui_if_verbose_with_project(qtbot):
- command = Command()
+def test_commandline_launches_gui_if_verbose_with_project(qtbot, command):
sys.argv = ["", "test", "--verbose"]
mode = command.parseArgs()
assert mode == "GUI"
-def test_commandline_tries_to_export(qtbot):
- command = Command()
+def test_commandline_tries_to_export(qtbot, command):
didCallFunction = False
def captureFunction(*args):
@@ -46,16 +41,13 @@ def test_commandline_tries_to_export(qtbot):
assert didCallFunction
-def test_commandline_parses_classic_by_alias(qtbot):
- command = Command()
+def test_commandline_parses_classic_by_alias(qtbot, command):
assert command.parseCompName("original") == "Classic Visualizer"
-def test_commandline_parses_conway_by_short_name(qtbot):
- command = Command()
+def test_commandline_parses_conway_by_short_name(qtbot, command):
assert command.parseCompName("conway") == "Conway's Game of Life"
-def test_commandline_parses_image_by_name(qtbot):
- command = Command()
+def test_commandline_parses_image_by_name(qtbot, command):
assert command.parseCompName("image") == "Image"