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
This commit is contained in:
Thomas Waldmann 2020-12-20 00:07:17 +01:00
parent 18f0729ed8
commit dc2a57af47
3 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ import pytest
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')

View file

@ -207,7 +207,7 @@ class TestCacheSynchronizer:
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:

View file

@ -70,7 +70,7 @@ class TestSleepingBandwidthLimiter:
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: