File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
tests/test_plugins/klayout/drc Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ banned-module-level-imports = ["scipy", "matplotlib"]
301301
302302[tool .pytest .ini_options ]
303303# TODO: remove --assert=plain when https://github.com/scipy/scipy/issues/22236 is resolved
304- addopts = " --cov=tidy3d --doctest-modules -n auto --dist worksteal --assert=plain -m 'not numerical' "
304+ addopts = " --cov=tidy3d --doctest-modules -n auto --dist worksteal --assert=plain -m 'not numerical' --ignore=tests/test_plugins/test_adjoint.py "
305305markers = [
306306 " numerical: marks numerical tests for adjoint gradients that require running simulations (deselect with '-m \" not numerical\" ')" ,
307307]
Original file line number Diff line number Diff line change 1818filepath = Path (os .path .dirname (os .path .abspath (__file__ )))
1919
2020
21- def test_check_klayout_not_installed ():
22- """Test that _check_klayout_on_path raises RuntimeError if klayout is not in the system path.
23- Assumes this is the case on the CI machine.
21+ def test_check_klayout_not_installed (monkeypatch ):
22+ """check_installation raises when KLayout is not on PATH.
23+
24+ Use monkeypatch to simulate absence, avoiding reliance on CI environment.
2425 """
26+ monkeypatch .setattr ("tidy3d.plugins.klayout.util.which" , lambda _cmd : None )
2527 with pytest .raises (RuntimeError ):
2628 check_installation (raise_error = True )
2729
2830
31+ def test_check_klayout_installed (monkeypatch ):
32+ """check_installation returns a path and does not raise when present."""
33+ fake_path = "/usr/local/bin/klayout"
34+ monkeypatch .setattr ("tidy3d.plugins.klayout.util.which" , lambda _cmd : fake_path )
35+ assert check_installation (raise_error = True ) == fake_path
36+
37+
2938class TestDRCRunner :
3039 """Test DRCRunner"""
3140
You can’t perform that action at this time.
0 commit comments