Skip to content

Commit 619a34e

Browse files
committed
setup => setup_method; teardown => teardown_method
1 parent e0e4c2e commit 619a34e

17 files changed

+54
-54
lines changed

paths_cli/tests/commands/test_md.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
make_1d_traj, CalvinistDynamics
1313

1414
class TestProgressReporter(object):
15-
def setup(self):
15+
def setup_method(self):
1616
self.progress = ProgressReporter(timestep=None, update_freq=5)
1717

1818
@pytest.mark.parametrize('timestep', [None, 0.1])
@@ -38,7 +38,7 @@ def test_report_progress(self, n_steps, force, capsys):
3838
assert out == ""
3939

4040
class TestEnsembleSatisfiedContinueConditions(object):
41-
def setup(self):
41+
def setup_method(self):
4242
cv = paths.CoordinateFunctionCV('x', lambda x: x.xyz[0][0])
4343
vol_A = paths.CVDefinedVolume(cv, float("-inf"), 0.0)
4444
vol_B = paths.CVDefinedVolume(cv, 1.0, float("inf"))

paths_cli/tests/compiling/_gendocs/test_docs_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from paths_cli.compiling.core import CategoryCompiler
1010

1111
class TestDocsGenerator:
12-
def setup(self):
12+
def setup_method(self):
1313
self.required_parameter = Parameter(
1414
name="req_param",
1515
loader=None,

paths_cli/tests/compiling/test_core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def mock_named_object_factory(dct):
2525

2626

2727
class TestParameter:
28-
def setup(self):
28+
def setup_method(self):
2929
self.loader = Mock(
3030
return_value='foo',
3131
json_type='string',
@@ -131,7 +131,7 @@ class TestInstanceCompilerPlugin:
131131
def _builder(req_param, opt_default=10, opt_override=100):
132132
return f"{req_param}, {opt_default}, {opt_override}"
133133

134-
def setup(self):
134+
def setup_method(self):
135135
identity = lambda x: x
136136
self.parameters = [
137137
Parameter('req_param', identity, json_type="string"),
@@ -227,7 +227,7 @@ def test_call(self):
227227

228228

229229
class TestCategoryCompiler:
230-
def setup(self):
230+
def setup_method(self):
231231
self.compiler = CategoryCompiler(
232232
{'foo': mock_named_object_factory},
233233
'foo_compiler'

paths_cli/tests/compiling/test_cvs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
class TestMDTrajFunctionCV:
18-
def setup(self):
18+
def setup_method(self):
1919
self.ad_pdb = data_filename("ala_small_traj.pdb")
2020
self.yml = "\n".join([
2121
"name: phi", "type: mdtraj", "topology: " + self.ad_pdb,

paths_cli/tests/compiling/test_engines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
import mdtraj as md
1313

1414
class TestOpenMMEngineBuilder(object):
15-
def setup(self):
15+
def setup_method(self):
1616
self.cwd = os.getcwd()
1717
self.yml = "\n".join([
1818
"type: openmm", "name: engine", "system: system.xml",
1919
"integrator: integrator.xml", "topology: ad.pdb",
2020
"n_steps_per_frame: 10", "n_frames_max: 10000"
2121
])
2222

23-
def teardown(self):
23+
def teardown_method(self):
2424
os.chdir(self.cwd)
2525

2626
def _create_files(self, tmpdir):

paths_cli/tests/compiling/test_plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from unittest.mock import Mock
44

55
class TestCompilerPlugin:
6-
def setup(self):
6+
def setup_method(self):
77
self.plugin_class = Mock(category='foo')
88
self.plugin = CategoryPlugin(self.plugin_class)
99
self.aliased_plugin = CategoryPlugin(self.plugin_class,

paths_cli/tests/compiling/test_root_compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_canonical_name(input_name):
5858

5959

6060
class TestCategoryCompilerProxy:
61-
def setup(self):
61+
def setup_method(self):
6262
self.compiler = CategoryCompiler(None, "foo")
6363
self.compiler.named_objs['bar'] = 'baz'
6464
self.proxy = _CategoryCompilerProxy('foo')

paths_cli/tests/compiling/test_volumes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from paths_cli.compiling.volumes import *
1515

1616
class TestBuildCVVolume:
17-
def setup(self):
17+
def setup_method(self):
1818
self.yml = "\n".join(["type: cv-volume", "cv: {func}",
1919
"lambda_min: 0", "lambda_max: 1"])
2020

@@ -90,7 +90,7 @@ def test_build_cv_volume(self, inline, periodic):
9090

9191

9292
class TestBuildCombinationVolume:
93-
def setup(self):
93+
def setup_method(self):
9494
from openpathsampling.experimental.storage.collective_variables \
9595
import CollectiveVariable
9696
self.cv = CollectiveVariable(lambda s: s.xyz[0][0]).named('foo')

paths_cli/tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class TestOpenPathSamplingCLI(object):
10-
def setup(self):
10+
def setup_method(self):
1111
def make_mock(name, helpless=False, return_val=None):
1212
if return_val is None:
1313
return_val = name

paths_cli/tests/test_file_copying.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from paths_cli.file_copying import *
1212

1313
class Test_PRECOMPUTE_CVS(object):
14-
def setup(self):
14+
def setup_method(self):
1515
self.tmpdir = tempfile.mkdtemp()
1616
self.storage_filename = os.path.join(self.tmpdir, "test.nc")
1717
self.storage = paths.Storage(self.storage_filename, mode='w')
@@ -21,7 +21,7 @@ def setup(self):
2121
self.cv_y = paths.CoordinateFunctionCV("y", lambda s: s.xyz[0][1])
2222
self.storage.save([self.cv_x, self.cv_y])
2323

24-
def teardown(self):
24+
def teardown_method(self):
2525
self.storage.close()
2626

2727
for filename in os.listdir(self.tmpdir):
@@ -53,7 +53,7 @@ def test_make_blocks(blocksize):
5353

5454

5555
class TestPrecompute(object):
56-
def setup(self):
56+
def setup_method(self):
5757
class RunOnceFunction(object):
5858
def __init__(self):
5959
self.previously_seen = set([])

0 commit comments

Comments
 (0)