mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-27 18:28:42 +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:
commit
af465a6339
3 changed files with 4 additions and 4 deletions
|
@ -13,7 +13,7 @@
|
||||||
from .archiver import changedir, cmd
|
from .archiver import changedir, cmd
|
||||||
|
|
||||||
|
|
||||||
@pytest.yield_fixture
|
@pytest.fixture
|
||||||
def repo_url(request, tmpdir, monkeypatch):
|
def repo_url(request, tmpdir, monkeypatch):
|
||||||
monkeypatch.setenv('BORG_PASSPHRASE', '123456')
|
monkeypatch.setenv('BORG_PASSPHRASE', '123456')
|
||||||
monkeypatch.setenv('BORG_CHECK_I_KNOW_WHAT_I_AM_DOING', 'YES')
|
monkeypatch.setenv('BORG_CHECK_I_KNOW_WHAT_I_AM_DOING', 'YES')
|
||||||
|
@ -31,7 +31,7 @@ def repo(request, cmd, repo_url):
|
||||||
return 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):
|
def testdata(request, tmpdir_factory):
|
||||||
count, size = 10, 1000*1000
|
count, size = 10, 1000*1000
|
||||||
p = tmpdir_factory.mktemp('data')
|
p = tmpdir_factory.mktemp('data')
|
||||||
|
|
|
@ -207,7 +207,7 @@ def test_refcount_one_below_max_value(self):
|
||||||
|
|
||||||
|
|
||||||
class TestAdHocCache:
|
class TestAdHocCache:
|
||||||
@pytest.yield_fixture
|
@pytest.fixture
|
||||||
def repository(self, tmpdir):
|
def repository(self, tmpdir):
|
||||||
self.repository_location = os.path.join(str(tmpdir), 'repository')
|
self.repository_location = os.path.join(str(tmpdir), 'repository')
|
||||||
with Repository(self.repository_location, exclusive=True, create=True) as repository:
|
with Repository(self.repository_location, exclusive=True, create=True) as repository:
|
||||||
|
|
|
@ -70,7 +70,7 @@ def test_write(self, monkeypatch):
|
||||||
|
|
||||||
|
|
||||||
class TestRepositoryCache:
|
class TestRepositoryCache:
|
||||||
@pytest.yield_fixture
|
@pytest.fixture
|
||||||
def repository(self, tmpdir):
|
def repository(self, tmpdir):
|
||||||
self.repository_location = os.path.join(str(tmpdir), 'repository')
|
self.repository_location = os.path.join(str(tmpdir), 'repository')
|
||||||
with Repository(self.repository_location, exclusive=True, create=True) as repository:
|
with Repository(self.repository_location, exclusive=True, create=True) as repository:
|
||||||
|
|
Loading…
Reference in a new issue