from __future__ import absolute_import
from __future__ import unicode_literals

import os
import subprocess

import mock
import pytest


@pytest.yield_fixture
def in_tmpdir(tmpdir):
    pwd = os.getcwd()
    os.chdir(tmpdir.strpath)
    try:
        yield
    finally:
        os.chdir(pwd)


@pytest.yield_fixture
def check_call_mock():
    with mock.patch.object(subprocess, 'check_call') as mocked:
        yield mocked

from __future__ import absolute_import
from __future__ import unicode_literals

import os
import subprocess

import mock
import pytest


@pytest.fixture
def in_tmpdir(tmpdir):
    pwd = os.getcwd()
    os.chdir(tmpdir.strpath)
    try:
        yield
    finally:
        os.chdir(pwd)


@pytest.fixture
def check_call_mock():
    with mock.patch.object(subprocess, 'check_call') as mocked:
        yield mocked

Replace deprecated yield_fixture with fixture
Replace deprecated yield_fixture with fixture

Committed via https://github.com/asottile/all-repos

  from __future__ import absolute_import
  from __future__ import unicode_literals
  
  import os
  import subprocess
  
  import mock
  import pytest
  
  
- @pytest.yield_fixture
+ @pytest.fixture
  def in_tmpdir(tmpdir):
      pwd = os.getcwd()
      os.chdir(tmpdir.strpath)
      try:
          yield
      finally:
          os.chdir(pwd)
  
  
- @pytest.yield_fixture
+ @pytest.fixture
  def check_call_mock():
      with mock.patch.object(subprocess, 'check_call') as mocked:
          yield mocked
  
Replace deprecated yield_fixture with fixture
## Code Before:
from __future__ import absolute_import
from __future__ import unicode_literals

import os
import subprocess

import mock
import pytest


@pytest.yield_fixture
def in_tmpdir(tmpdir):
    pwd = os.getcwd()
    os.chdir(tmpdir.strpath)
    try:
        yield
    finally:
        os.chdir(pwd)


@pytest.yield_fixture
def check_call_mock():
    with mock.patch.object(subprocess, 'check_call') as mocked:
        yield mocked

## Instruction:
Replace deprecated yield_fixture with fixture
## Code After:
from __future__ import absolute_import
from __future__ import unicode_literals

import os
import subprocess

import mock
import pytest


@pytest.fixture
def in_tmpdir(tmpdir):
    pwd = os.getcwd()
    os.chdir(tmpdir.strpath)
    try:
        yield
    finally:
        os.chdir(pwd)


@pytest.fixture
def check_call_mock():
    with mock.patch.object(subprocess, 'check_call') as mocked:
        yield mocked
