Skip to content

Commit

Permalink
Fixed pytest exception with scheduler
Browse files Browse the repository at this point in the history
Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>
  • Loading branch information
jetchirag committed Aug 21, 2023
1 parent 1b0f0b6 commit a56af3a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,16 @@ def init_db(qapp, qtbot, tmpdir_factory):
source_dir = SourceFileModel(dir='/tmp/another', repo=new_repo, dir_size=100, dir_files_count=18, path_isdir=True)
source_dir.save()

# qapp.main_window.deleteLater()
# del qapp.main_window
qapp.main_window.deleteLater()
del qapp.main_window
qapp.main_window = MainWindow(qapp) # Re-open main window to apply mock data in UI

qapp.scheduler.schedule_changed.disconnect()

yield

qapp.jobs_manager.cancel_all_jobs()
qapp.backup_finished_event.disconnect()
qapp.scheduler.schedule_changed.disconnect()
qtbot.waitUntil(lambda: not qapp.jobs_manager.is_worker_running(), **pytest._wait_defaults)
mock_db.close()

Expand Down

0 comments on commit a56af3a

Please sign in to comment.