-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathconftest.py
More file actions
58 lines (40 loc) · 1.51 KB
/
Copy pathconftest.py
File metadata and controls
58 lines (40 loc) · 1.51 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import sys
from pathlib import Path
import pytest
tests_folder = str(Path(__file__).parent)
if tests_folder not in sys.path:
sys.path.insert(0, tests_folder)
import common
from utilities import get_runtime_data_folder, remove_directory_recursively
import yup
#==================================================================================================
def pytest_addoption(parser):
parser.addoption("--update-rendering", action="store_true", default=False)
def pytest_generate_tests(metafunc):
option_value = metafunc.config.option.update_rendering
if "update_rendering" in metafunc.fixturenames and option_value:
metafunc.parametrize("update_rendering", [option_value])
def pytest_unconfigure(config):
if sys.gettrace() is not None:
return
remove_directory_recursively(get_runtime_data_folder().getFullPathName(), [".gitignore"])
#==================================================================================================
def yield_test():
yield
@pytest.fixture
def juce_app():
class Application(yup.YUPApplication):
def __init__(self):
super().__init__()
def getApplicationName(self):
return "TestApp"
def getApplicationVersion(self):
return "1.0"
def initialise(self, commandLineParameters: str):
yup.MessageManager.callAsync(yield_test)
def shutdown(self):
pass
with yup.TestApplication(Application) as app:
next(app)
yield app
next(app)