Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: switch from deprecated setup to setup_method #78

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MyDerivedClass(mm.abstract.Abstract):


class TestAbstract:
def setup(self):
def setup_method(self):
self.obj = MyDerivedClass(arg1=1, arg2="abc")

def test_init(self):
Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_cubicanisotropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class TestCubicAnisotropy:
def setup(self):
def setup_method(self):
mesh = df.Mesh(p1=(0, 0, 0), p2=(5, 5, 5), cell=(1, 1, 1))
Kfield = df.Field(mesh, nvdim=1, value=5e6)
u1field = df.Field(mesh, nvdim=3, value=(1, 0, 0))
Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_damping.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class TestDamping:
def setup(self):
def setup_method(self):
mesh = df.Mesh(p1=(0, 0, 0), p2=(5, 5, 5), cell=(1, 1, 1))
field = df.Field(mesh, nvdim=1, value=0.1)

Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_dmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class TestDMI:
def setup(self):
def setup_method(self):
mesh = df.Mesh(p1=(0, 0, 0), p2=(5, 5, 5), cell=(1, 1, 1))
field = df.Field(mesh, nvdim=1, value=5e-3)

Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class TestDynamics:
def setup(self):
def setup_method(self):
self.precession = mm.Precession(gamma0=2.21e5)
self.damping = mm.Damping(alpha={"r1": 1, "r2": 0.5})
self.zhangli = mm.ZhangLi(u=500, beta=0.2)
Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class TestEnergy:
def setup(self):
def setup_method(self):
self.exchange = mm.Exchange(A=1e-12)
self.zeeman = mm.Zeeman(H=(0, 0, 1.2e6))
self.uniaxialanisotropy = mm.UniaxialAnisotropy(K=1e4, u=(0, 1, 0))
Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class TestExchange:
def setup(self):
def setup_method(self):
mesh = df.Mesh(p1=(0, 0, 0), p2=(5, 5, 5), cell=(1, 1, 1))
field = df.Field(mesh, nvdim=1, value=5e-12)

Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_magnetoelastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class TestMagnetoElastic:
def setup(self):
def setup_method(self):
mesh = df.Mesh(p1=(0, 0, 0), p2=(5, 5, 5), cell=(1, 1, 1))
B1field = df.Field(mesh, nvdim=1, value=5e6)
B2field = df.Field(mesh, nvdim=1, value=7e6)
Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_precession.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class TestPrecession:
def setup(self):
def setup_method(self):
mesh = df.Mesh(p1=(0, 0, 0), p2=(5, 5, 5), cell=(1, 1, 1))
field = df.Field(mesh, nvdim=1, value=5e-12)

Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_rkky.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class TestRKKY:
def setup(self):
def setup_method(self):
self.valid_args = [(1, ["a", "b"]), (-1, ["a", "bc"]), (0, ["r1", "r2"])]
self.invalid_args = [("a", ["a", "b"]), (-1, "a"), (0, 0)]

Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_slonczewski.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class TestSlonczewski:
def setup(self):
def setup_method(self):
mesh = df.Mesh(p1=(0, 0, 0), p2=(5, 5, 5), cell=(1, 1, 1))
field = df.Field(mesh, nvdim=1, value=5e-12)

Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


class TestSystem:
def setup(self):
def setup_method(self):
p1 = (0, 0, 0)
p2 = (10e-9, 10e-9, 10e-9)
n = (10, 10, 10)
Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_uniaxialanisotropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class TestUniaxialAnisotropy:
def setup(self):
def setup_method(self):
mesh = df.Mesh(p1=(0, 0, 0), p2=(5, 5, 5), cell=(1, 1, 1))
Kfield = df.Field(mesh, nvdim=1, value=5e6)
ufield = df.Field(mesh, nvdim=3, value=(1, 0, 0))
Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_zeeman.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class TestZeeman:
def setup(self):
def setup_method(self):
mesh = df.Mesh(p1=(0, 0, 0), p2=(5, 5, 5), cell=(1, 1, 1))
field = df.Field(mesh, nvdim=3, value=(-1e5, 0, 1e6))

Expand Down
2 changes: 1 addition & 1 deletion micromagneticmodel/tests/test_zhangli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class TestZhangLi:
def setup(self):
def setup_method(self):
self.valid_args = [
(1, 1),
(-1.0, 2.0),
Expand Down
Loading