Skip to content

Commit 551938f

Browse files
committed
test building gallery
1 parent 2aed30b commit 551938f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/embedding/test_app.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,26 @@ def test_app_getters_notstale(embedded_app):
202202
assert model.Name != "b"
203203

204204

205+
@pytest.mark.embedding
206+
def test_building_gallery(embedded_app):
207+
"""Test for checking building gallery .
208+
209+
When building gallery each example files create
210+
an instance of app. When BUILDING GALLERY flag is enabled,
211+
only one instance is kept.
212+
"""
213+
import ansys.mechanical.core as mech
214+
215+
_version = embedded_app.version
216+
embedded_app.update_globals(globals())
217+
embedded_app.new()
218+
with pytest.raises(Exception):
219+
embedded_app2 = mech.App(version=_version)
220+
mech.BUILDING_GALLERY = True
221+
embedded_app3 = mech.App(version=_version)
222+
embedded_app3.update_globals(globals())
223+
224+
205225
@pytest.mark.embedding_scripts
206226
@pytest.mark.python_env
207227
def test_warning_message(test_env, pytestconfig, run_subprocess, rootdir):

0 commit comments

Comments
 (0)