Skip to content

Commit

Permalink
use pytest.fixture instead of yield_fixture, fixes borgbackup#5575
Browse files Browse the repository at this point in the history
/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
  • Loading branch information
ThomasWaldmann committed Dec 19, 2020
1 parent 368d3e7 commit e9c5e3e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/borg/testsuite/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion src/borg/testsuite/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,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:
Expand Down
2 changes: 1 addition & 1 deletion src/borg/testsuite/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e9c5e3e

Please sign in to comment.