Replace deprecated yield_fixture with fixture

Committed via https://github.com/asottile/all-repos
This commit is contained in:
Anthony Sottile 2018-01-21 15:31:17 -08:00
parent 98ec74dcab
commit 0f54fedac9
6 changed files with 28 additions and 28 deletions

View file

@ -25,7 +25,7 @@ from testing.fixtures import write_config
from testing.util import get_resource_path
@pytest.yield_fixture
@pytest.fixture
def up_to_date_repo(tempdir_factory):
yield make_repo(tempdir_factory, 'python_hooks_repo')
@ -81,7 +81,7 @@ def test_autoupdate_old_revision_broken(
assert update_rev in after
@pytest.yield_fixture
@pytest.fixture
def out_of_date_repo(tempdir_factory):
path = make_repo(tempdir_factory, 'python_hooks_repo')
original_sha = git.head_sha(path)
@ -221,7 +221,7 @@ def test_loses_formatting_when_not_detectable(
assert after == expected
@pytest.yield_fixture
@pytest.fixture
def tagged_repo(out_of_date_repo):
with cwd(out_of_date_repo.path):
cmd_output('git', 'tag', 'v1.2.3')
@ -241,7 +241,7 @@ def test_autoupdate_tagged_repo(
assert 'v1.2.3' in open(C.CONFIG_FILE).read()
@pytest.yield_fixture
@pytest.fixture
def tagged_repo_with_more_commits(tagged_repo):
with cwd(tagged_repo.path):
cmd_output('git', 'commit', '--allow-empty', '-m', 'commit!')
@ -262,7 +262,7 @@ def test_autoupdate_tags_only(
assert 'v1.2.3' in open(C.CONFIG_FILE).read()
@pytest.yield_fixture
@pytest.fixture
def hook_disappearing_repo(tempdir_factory):
path = make_repo(tempdir_factory, 'python_hooks_repo')
original_sha = git.head_sha(path)

View file

@ -29,14 +29,14 @@ from testing.util import run_opts
from testing.util import xfailif_no_symlink
@pytest.yield_fixture
@pytest.fixture
def repo_with_passing_hook(tempdir_factory):
git_path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
with cwd(git_path):
yield git_path
@pytest.yield_fixture
@pytest.fixture
def repo_with_failing_hook(tempdir_factory):
git_path = make_consuming_repo(tempdir_factory, 'failing_hook_repo')
with cwd(git_path):
@ -699,7 +699,7 @@ def test_meta_hook_passes(
)
@pytest.yield_fixture
@pytest.fixture
def modified_config_repo(repo_with_passing_hook):
with modify_config(repo_with_passing_hook, commit=False) as config:
# Some minor modification