From dc2a57af47363b9f8413ad0cc15c0ea0906a6bea Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 20 Dec 2020 00:07:17 +0100 Subject: [PATCH] use pytest.fixture instead of yield_fixture, fixes #5575 /vagrant/borg/borg/.tox/py36-none/lib/python3.6/site-packages/borg/testsuite/remote.py:73: PytestDeprecationWarning: @pytest.yield_fixture is deprecated. Use @pytest.fixture instead; they are the same. Docs: https://docs.pytest.org/en/stable/warnings.html --- src/borg/testsuite/benchmark.py | 4 ++-- src/borg/testsuite/cache.py | 2 +- src/borg/testsuite/remote.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/borg/testsuite/benchmark.py b/src/borg/testsuite/benchmark.py index dcc71b011..1e70a101f 100644 --- a/src/borg/testsuite/benchmark.py +++ b/src/borg/testsuite/benchmark.py @@ -13,7 +13,7 @@ from .archiver import changedir, cmd -@pytest.yield_fixture +@pytest.fixture def repo_url(request, tmpdir, monkeypatch): monkeypatch.setenv('BORG_PASSPHRASE', '123456') monkeypatch.setenv('BORG_CHECK_I_KNOW_WHAT_I_AM_DOING', 'YES') @@ -31,7 +31,7 @@ def repo(request, cmd, repo_url): return repo_url -@pytest.yield_fixture(scope='session', params=["zeros", "random"]) +@pytest.fixture(scope='session', params=["zeros", "random"]) def testdata(request, tmpdir_factory): count, size = 10, 1000*1000 p = tmpdir_factory.mktemp('data') diff --git a/src/borg/testsuite/cache.py b/src/borg/testsuite/cache.py index a0993f74c..1eb350f35 100644 --- a/src/borg/testsuite/cache.py +++ b/src/borg/testsuite/cache.py @@ -207,7 +207,7 @@ def test_refcount_one_below_max_value(self): class TestAdHocCache: - @pytest.yield_fixture + @pytest.fixture def repository(self, tmpdir): self.repository_location = os.path.join(str(tmpdir), 'repository') with Repository(self.repository_location, exclusive=True, create=True) as repository: diff --git a/src/borg/testsuite/remote.py b/src/borg/testsuite/remote.py index d91177174..034ebb4ba 100644 --- a/src/borg/testsuite/remote.py +++ b/src/borg/testsuite/remote.py @@ -70,7 +70,7 @@ def test_write(self, monkeypatch): class TestRepositoryCache: - @pytest.yield_fixture + @pytest.fixture def repository(self, tmpdir): self.repository_location = os.path.join(str(tmpdir), 'repository') with Repository(self.repository_location, exclusive=True, create=True) as repository: