Skip to content

Commit

Permalink
chore: fix pytest deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
K900 committed Oct 25, 2023
1 parent eb2cfe4 commit 283a6a2
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions tests/functional/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
class DatabaseUsingTest(object):
_multiprocess_can_split_ = True

def setup(self):
def setup_method(self):
self.sf = StateFile(db_file, writable=True)

def teardown(self):
def teardown_method(self):
self.sf.close()
4 changes: 2 additions & 2 deletions tests/functional/generic_deployment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class GenericDeploymentTest(DatabaseUsingTest):
def setup(self):
super(GenericDeploymentTest, self).setup()
def setup_method(self):
super(GenericDeploymentTest, self).setup_method()
self.depl = self.sf.create_deployment()
self.depl.logger.set_autoresponse("y")
4 changes: 2 additions & 2 deletions tests/functional/single_machine_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
class SingleMachineTest(GenericDeploymentTest):
_multiprocess_can_split_ = True

def setup(self):
super(SingleMachineTest, self).setup()
def setup_method(self):
super(SingleMachineTest, self).setup_method()
self.depl.network_expr = NetworkFile(logical_spec)

def check_command(self, command):
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_invalid_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@


class TestInvalidIdentifier(GenericDeploymentTest):
def setup(self):
super(TestInvalidIdentifier, self).setup()
def setup_method(self):
super(TestInvalidIdentifier, self).setup_method()
self.depl.network_expr = NetworkFile(logical_spec)

def test_invalid_identifier_fails_evaluation(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_rollback_rollsback.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
class TestRollbackRollsback(SingleMachineTest):
_multiprocess_can_split_ = True

def setup(self):
super(TestRollbackRollsback, self).setup()
def setup_method(self):
super(TestRollbackRollsback, self).setup_method()
self.depl.network_expr = NetworkFile(rollback_spec)
self.depl.nix_exprs = self.depl.nix_exprs + [rollback_spec]

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_send_keys_sends_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
class TestSendKeysSendsKeys(SingleMachineTest):
_multiprocess_can_split_ = True

def setup(self):
super(TestSendKeysSendsKeys, self).setup()
def setup_method(self):
super(TestSendKeysSendsKeys, self).setup_method()
self.depl.nix_exprs = self.depl.nix_exprs + [
secret_key_spec,
elsewhere_key_spec,
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_ssh_key_pair_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@


class TestSSHKeyPairResource(GenericDeploymentTest):
def setup(self):
super(TestSSHKeyPairResource, self).setup()
def setup_method(self):
super(TestSSHKeyPairResource, self).setup_method()
self.depl.network_expr = NetworkFile(ssh_key_pair_spec)

def test_evaluate(self):
Expand Down

0 comments on commit 283a6a2

Please sign in to comment.