Skip to content

Commit fcc6f31

Browse files
committed
Fix conftest.py
1 parent 3a190ac commit fcc6f31

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

tests/conftest.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
import optimagic.optimizers.tranquilo as t
21
from _pytest.monkeypatch import MonkeyPatch
32

4-
_mp = MonkeyPatch()
3+
from tranquilo.config import IS_OPTIMAGIC_INSTALLED
54

5+
if IS_OPTIMAGIC_INSTALLED:
6+
import optimagic.optimizers.tranquilo as t
67

7-
def pytest_configure(config):
8-
_mp.setattr(
9-
t, "IS_TRANQUILO_VERSION_NEWER_OR_EQUAL_TO_0_1_0", "patched-value", raising=True
10-
)
8+
_mp = MonkeyPatch()
119

10+
def pytest_configure(config):
11+
_mp.setattr(
12+
t,
13+
"IS_TRANQUILO_VERSION_NEWER_OR_EQUAL_TO_0_1_0",
14+
"patched-value",
15+
raising=True,
16+
)
1217

13-
def pytest_unconfigure(config):
14-
_mp.undo()
18+
def pytest_unconfigure(config):
19+
_mp.undo()

0 commit comments

Comments
 (0)