forked from OpenCobolIDE/OpenCobolIDE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
41 lines (32 loc) · 833 Bytes
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Configures the test suite and describe the global fixture that can be used
in functional tests.
"""
import pytest
import shutil
from open_cobol_ide import __version__, main
main.override_sys_path()
from open_cobol_ide.app import Application # noqa
from open_cobol_ide.logger import setup_logging # noqa
from open_cobol_ide.settings import Settings # noqa
setup_logging(__version__)
_app = None
try:
shutil.rmtree('test/testfiles/bin')
except OSError:
pass
@pytest.fixture(scope="session")
def app(request):
global _app
# always starts with default settings
s = Settings()
s.clear()
s.perspective = 'default'
_app = Application(parse_args=False)
def fin():
global _app
_app.exit()
del _app
# _app.win.hide()
request.addfinalizer(fin)
return _app