Skip to content

Commit 38d502a

Browse files
committed
passing: IO, base, beam, boundaries, custom, eme, field_projection, geometry, log
1 parent 2bb7c18 commit 38d502a

20 files changed

Lines changed: 238 additions & 241 deletions

tests/test_components/test_IO.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def test_validation_speed(tmp_path):
190190
for i in range(n):
191191
new_structure = SIM.structures[0].copy(update={"name": str(i)})
192192
new_structures.append(new_structure)
193-
S = SIM.copy(update=dict(structures=new_structures))
193+
S = SIM.copy(update=dict(structures=tuple(new_structures)))
194194

195195
S.to_file(path)
196196
time_start = time()

tests/test_components/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_updated_copy_path():
168168
)
169169

170170
# forgot path
171-
with pytest.raises(ValueError):
171+
with pytest.raises(KeyError):
172172
assert sim == sim.updated_copy(permittivity=2.0)
173173

174174
assert sim.updated_copy(size=(6, 6, 6)) == sim.updated_copy(size=(6, 6, 6), path=None)

tests/test_components/test_beam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Tests for the various BeamProfile components."""
22

33
import numpy as np
4-
import pydantic.v1 as pd
54
import pytest
5+
from pydantic import ValidationError
66
from tidy3d.components.beam import (
77
AstigmaticGaussianBeamProfile,
88
GaussianBeamProfile,
@@ -94,7 +94,7 @@ def test_invalid_beam_size():
9494
center = (0, 0, 0)
9595
size = (10, 10, 10)
9696
resolution = 100
97-
with pytest.raises(pd.ValidationError):
97+
with pytest.raises(ValidationError):
9898
GaussianBeamProfile(center=center, size=size, resolution=resolution, freqs=FREQS)
9999

100100

tests/test_components/test_boundaries.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Tests boundary conditions."""
22

3-
import pydantic.v1 as pydantic
43
import pytest
54
import tidy3d as td
5+
from pydantic import ValidationError
66
from tidy3d.components.boundary import (
77
PML,
88
Absorber,
@@ -78,11 +78,11 @@ def test_boundary_validators():
7878
periodic = Periodic()
7979

8080
# test `bloch_on_both_sides`
81-
with pytest.raises(pydantic.ValidationError):
81+
with pytest.raises(ValidationError):
8282
_ = Boundary(plus=bloch, minus=pec)
8383

8484
# test `periodic_with_pml`
85-
with pytest.raises(pydantic.ValidationError):
85+
with pytest.raises(ValidationError):
8686
_ = Boundary(plus=periodic, minus=pml)
8787

8888

0 commit comments

Comments
 (0)