1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 01:37:20 +00:00

Merge pull request #5578 from ThomasWaldmann/fix-yield-fixture-deprecation-master

use pytest.fixture instead of yield_fixture, fixes #5575 (master)
This commit is contained in:
TW 2020-12-20 00:40:34 +01:00 committed by GitHub
commit af465a6339
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -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')

View file

@ -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:

View file

@ -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: