summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Cope <olly@ollycope.com>2022-12-14 13:54:57 +0000
committerOlly Cope <olly@ollycope.com>2022-12-14 13:54:57 +0000
commit6bbd7f29ff77841b9b0063d9457e6a7b1bd7b023 (patch)
tree4e54a26897d136dc8593883693387776f62d450f
parentfa05005b54c7c32014d88124672bdd19696bef64 (diff)
downloadyoyo-6bbd7f29ff77841b9b0063d9457e6a7b1bd7b023.tar.gz
tests: fix pytest deprecation warnings
-rw-r--r--yoyo/tests/test_cli_script.py12
-rw-r--r--yoyo/tests/test_migrations.py2
2 files changed, 7 insertions, 7 deletions
diff --git a/yoyo/tests/test_cli_script.py b/yoyo/tests/test_cli_script.py
index 1160667..3291d5e 100644
--- a/yoyo/tests/test_cli_script.py
+++ b/yoyo/tests/test_cli_script.py
@@ -46,7 +46,7 @@ def is_tmpfile(p, directory=None):
class TestInteractiveScript(object):
- def setup(self):
+ def setup_method(self):
self.stdout_tty_patch = patch("sys.stdout.isatty", return_value=True)
self.stdout_tty_patch.start()
self.confirm_patch = patch("yoyo.utils.confirm", return_value=False)
@@ -58,7 +58,7 @@ class TestInteractiveScript(object):
self.saved_cwd = os.getcwd()
os.chdir(self.tmpdir)
- def teardown(self):
+ def teardown_method(self):
self.prompt_patch.stop()
self.confirm_patch.stop()
self.stdout_tty_patch.stop()
@@ -390,19 +390,19 @@ class TestUnmarkCommand(TestInteractiveScript):
class TestNewMigration(TestInteractiveScript):
- def setup(self):
+ def setup_method(self):
def mockstat(f, c=count()):
return Mock(st_mtime=next(c))
- super(TestNewMigration, self).setup()
+ super(TestNewMigration, self).setup_method()
self.subprocess_patch = patch("yoyo.scripts.newmigration.subprocess")
self.subprocess = self.subprocess_patch.start()
self.subprocess.call.return_value = 0
self.stat_patch = patch("yoyo.scripts.newmigration.stat", mockstat)
self.stat_patch.start()
- def teardown(self):
- super(TestNewMigration, self).teardown()
+ def teardown_method(self):
+ super(TestNewMigration, self).teardown_method()
self.subprocess_patch.stop()
self.stat_patch.stop()
diff --git a/yoyo/tests/test_migrations.py b/yoyo/tests/test_migrations.py
index 0eea603..985fb84 100644
--- a/yoyo/tests/test_migrations.py
+++ b/yoyo/tests/test_migrations.py
@@ -302,7 +302,7 @@ class TestMigrationList(object):
class TestAncestorsDescendants(object):
- def setup(self):
+ def setup_method(self):
self.m1 = Mock(id="m1", depends=["m2", "m3"])
self.m2 = Mock(id="m2", depends=["m3"])
self.m3 = Mock(id="m3", depends=["m5"])