mirror of
https://github.com/lutris/lutris
synced 2024-10-14 11:42:36 +00:00
Further configuration to skip initialization during tests
This commit is contained in:
parent
83c6aed0e0
commit
838b46d0e1
|
@ -208,6 +208,7 @@ class Application(Gtk.Application):
|
|||
self.add_accelerator("<Primary>q", "app.quit")
|
||||
|
||||
if os.environ.get("LUTRIS_SKIP_INIT"):
|
||||
self._print("Skipping initialization")
|
||||
return
|
||||
init_dialog = LutrisInitDialog(init_lutris)
|
||||
init_dialog.run()
|
||||
|
|
6
lutris/util/test_config.py
Normal file
6
lutris/util/test_config.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
import os
|
||||
|
||||
|
||||
def setup_test_environment():
|
||||
"""Sets up a system to be able to run tests"""
|
||||
os.environ["LUTRIS_SKIP_INIT"] = "1"
|
|
@ -7,15 +7,16 @@ gi.require_version('Gtk', '3.0')
|
|||
from gi.repository import Gtk
|
||||
from lutris.database import games as games_db
|
||||
from lutris.game import Game
|
||||
from lutris.startup import init_lutris
|
||||
# from lutris import settings
|
||||
from lutris.gui.config.common import GameDialogCommon
|
||||
from lutris.gui.config.add_game import AddGameDialog
|
||||
from lutris.gui.application import Application
|
||||
from lutris.gui.views.store import sort_func
|
||||
from lutris.util.test_config import setup_test_environment
|
||||
from lutris import runners
|
||||
|
||||
TEST_PGA_PATH = os.path.join(os.path.dirname(__file__), 'pga.db')
|
||||
setup_test_environment()
|
||||
|
||||
|
||||
class TestGameDialogCommon(TestCase):
|
||||
|
@ -30,7 +31,6 @@ class TestGameDialogCommon(TestCase):
|
|||
|
||||
class TestGameDialog(TestCase):
|
||||
def setUp(self):
|
||||
init_lutris()
|
||||
lutris_application = Application()
|
||||
lutris_window = lutris_application.window
|
||||
self.dlg = AddGameDialog(lutris_window)
|
||||
|
|
Loading…
Reference in a new issue