Skip to content

Commit 7ba1b0c

Browse files
committed
Stop using test function to get window instance
1 parent 631ad50 commit 7ba1b0c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/labelme_tests/test_app.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ def test_MainWindow_open_json(qtbot):
5555
win.close()
5656

5757

58-
@pytest.mark.gui
59-
def test_MainWindow_open_dir(qtbot):
58+
def create_MainWindow_with_directory(qtbot):
6059
directory = osp.join(data_dir, "raw")
6160
win = labelme.app.MainWindow(filename=directory)
6261
qtbot.addWidget(win)
@@ -66,13 +65,13 @@ def test_MainWindow_open_dir(qtbot):
6665

6766
@pytest.mark.gui
6867
def test_MainWindow_openNextImg(qtbot):
69-
win = test_MainWindow_open_dir(qtbot)
68+
win = create_MainWindow_with_directory(qtbot)
7069
win.openNextImg()
7170

7271

7372
@pytest.mark.gui
7473
def test_MainWindow_openPrevImg(qtbot):
75-
win = test_MainWindow_open_dir(qtbot)
74+
win = create_MainWindow_with_directory(qtbot)
7675
win.openNextImg()
7776

7877

0 commit comments

Comments
 (0)