Skip to content

Commit

Permalink
Stop using test function to get window instance
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Dec 2, 2023
1 parent a1234ab commit 3d43204
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/labelme_tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ def test_MainWindow_open_json(qtbot):
win.close()


@pytest.mark.gui
def test_MainWindow_open_dir(qtbot):
def create_MainWindow_with_directory(qtbot):
directory = osp.join(data_dir, "raw")
win = labelme.app.MainWindow(filename=directory)
qtbot.addWidget(win)
Expand All @@ -66,13 +65,13 @@ def test_MainWindow_open_dir(qtbot):

@pytest.mark.gui
def test_MainWindow_openNextImg(qtbot):
win = test_MainWindow_open_dir(qtbot)
win = create_MainWindow_with_directory(qtbot)
win.openNextImg()


@pytest.mark.gui
def test_MainWindow_openPrevImg(qtbot):
win = test_MainWindow_open_dir(qtbot)
win = create_MainWindow_with_directory(qtbot)
win.openNextImg()


Expand Down

0 comments on commit 3d43204

Please sign in to comment.