Skip to content

Commit 105a6fe

Browse files
committed
Tests: workaround AllowForms issue on CI
Windows-2022 apparently doesn't allocate a console anymore.
1 parent 81dbfcc commit 105a6fe

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_opendssdirect.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,16 @@ def test_configuration():
208208
# disabled.
209209
assert not dss.Basic.AllowForms(), "Allow forms should be disabled by default"
210210

211-
dss.Basic.AllowForms(True)
212-
assert dss.Basic.AllowForms()
211+
check_if_true = True
212+
try:
213+
dss.Basic.AllowForms(True)
214+
except:
215+
# On Windows, without a console, we cannot activate this.
216+
# Users can use the callback mechanism to integrate to GUIs though.
217+
check_if_true = False
218+
219+
if check_if_true:
220+
assert dss.Basic.AllowForms()
213221

214222
dss.Basic.AllowForms(False)
215223
assert not dss.Basic.AllowForms()

0 commit comments

Comments
 (0)