import shutil

from behave_pytest.hook import install_pytest_asserts

from paasta_tools.utils import get_docker_client


def before_all(context):
    install_pytest_asserts()


def after_scenario(context, scenario):
    if getattr(context, "tmpdir", None):
        shutil.rmtree(context.tmpdir)
    if getattr(context, "running_container_id", None):
        docker_client = get_docker_client()
        docker_client.stop(container=context.running_container_id)
        docker_client.remove_container(container=context.running_container_id)
    if getattr(context, "fake_http_server", None):
        context.fake_http_server.shutdown()
        context.fake_http_server = None

import shutil

from paasta_tools.utils import get_docker_client


def after_scenario(context, scenario):
    if getattr(context, "tmpdir", None):
        shutil.rmtree(context.tmpdir)
    if getattr(context, "running_container_id", None):
        docker_client = get_docker_client()
        docker_client.stop(container=context.running_container_id)
        docker_client.remove_container(container=context.running_container_id)
    if getattr(context, "fake_http_server", None):
        context.fake_http_server.shutdown()
        context.fake_http_server = None

Remove behave_pytest from general_itests too
Remove behave_pytest from general_itests too

  import shutil
  
- from behave_pytest.hook import install_pytest_asserts
- 
  from paasta_tools.utils import get_docker_client
- 
- 
- def before_all(context):
-     install_pytest_asserts()
  
  
  def after_scenario(context, scenario):
      if getattr(context, "tmpdir", None):
          shutil.rmtree(context.tmpdir)
      if getattr(context, "running_container_id", None):
          docker_client = get_docker_client()
          docker_client.stop(container=context.running_container_id)
          docker_client.remove_container(container=context.running_container_id)
      if getattr(context, "fake_http_server", None):
          context.fake_http_server.shutdown()
          context.fake_http_server = None
  
Remove behave_pytest from general_itests too
## Code Before:
import shutil

from behave_pytest.hook import install_pytest_asserts

from paasta_tools.utils import get_docker_client


def before_all(context):
    install_pytest_asserts()


def after_scenario(context, scenario):
    if getattr(context, "tmpdir", None):
        shutil.rmtree(context.tmpdir)
    if getattr(context, "running_container_id", None):
        docker_client = get_docker_client()
        docker_client.stop(container=context.running_container_id)
        docker_client.remove_container(container=context.running_container_id)
    if getattr(context, "fake_http_server", None):
        context.fake_http_server.shutdown()
        context.fake_http_server = None

## Instruction:
Remove behave_pytest from general_itests too
## Code After:
import shutil

from paasta_tools.utils import get_docker_client


def after_scenario(context, scenario):
    if getattr(context, "tmpdir", None):
        shutil.rmtree(context.tmpdir)
    if getattr(context, "running_container_id", None):
        docker_client = get_docker_client()
        docker_client.stop(container=context.running_container_id)
        docker_client.remove_container(container=context.running_container_id)
    if getattr(context, "fake_http_server", None):
        context.fake_http_server.shutdown()
        context.fake_http_server = None
