# Path: seaworthy/checks.py
# @contextmanager
# def docker_client():
#     """
#     A context manager that creates and cleans up a Docker API client.
# 
#     In most cases, it's better to use :class:`~seaworthy.helpers.DockerHelper`
#     instead.
#     """
#     client = docker.client.from_env()
#     yield client
#     client.api.close()
# 
# Path: seaworthy/helpers.py
# def fetch_images(client, images):
#     """
#     Fetch images if they aren't already present.
#     """
#     return [fetch_image(client, image) for image in images]
# 
# Path: seaworthy/pytest/checks.py
# def dockertest():
#     """
#     Skip tests that require Docker to be available.
# 
#     This is a function that returns a decorator so that we don't run arbitrary
#     Docker client code on import. Unlike :func:`seaworthy.checks.dockertest`,
#     this implementation doesn't require :class:`unittest.TestCase`. It does,
#     however, require pytest.
#     """
#     return pytest.mark.skipif(
#         not docker_available(), reason='Docker not available.')


from seaworthy.checks import docker_client
from seaworthy.helpers import fetch_images
from seaworthy.pytest.checks import dockertest
                assert container.inner().status == 'running'
                assert container.volume.created
        """)

        result = testdir.runpytest()
        result.assert_outcomes(passed=1)


@dockertest()
class TestCleanContainerFixturesFunc:
    def test_fixture(self, testdir):
        """
        When the fixture is used in a test, it should be cleaned when the test
        function is marked to be cleaned. The container passed to the test
        function should be running.
        """
        testdir.makeconftest("""
            from seaworthy.definitions import ContainerDefinition
            from seaworthy.pytest.fixtures import clean_container_fixtures


            class CleanableContainer(ContainerDefinition):
                def __init__(self):
                    super().__init__(name='test', image='{}')
                    self.cleaned = False

                def clean(self):
                    self.cleaned = True

                def was_cleaned(self):

# Path: seaworthy/checks.py
# @contextmanager
# def docker_client():
#     """
#     A context manager that creates and cleans up a Docker API client.
# 
#     In most cases, it's better to use :class:`~seaworthy.helpers.DockerHelper`
#     instead.
#     """
#     client = docker.client.from_env()
#     yield client
#     client.api.close()
# 
# Path: seaworthy/helpers.py
# def fetch_images(client, images):
#     """
#     Fetch images if they aren't already present.
#     """
#     return [fetch_image(client, image) for image in images]
# 
# Path: seaworthy/pytest/checks.py
# def dockertest():
#     """
#     Skip tests that require Docker to be available.
# 
#     This is a function that returns a decorator so that we don't run arbitrary
#     Docker client code on import. Unlike :func:`seaworthy.checks.dockertest`,
#     this implementation doesn't require :class:`unittest.TestCase`. It does,
#     however, require pytest.
#     """
#     return pytest.mark.skipif(
#         not docker_available(), reason='Docker not available.')


# Path: seaworthy/tests-pytest/test_fixtures_pytester.py
from seaworthy.checks import docker_client
from seaworthy.helpers import fetch_images
from seaworthy.pytest.checks import dockertest

                assert container.inner().status == 'running'
                assert container.volume.created
        """)

        result = testdir.runpytest()
        result.assert_outcomes(passed=1)


@dockertest()
class TestCleanContainerFixturesFunc:
    def test_fixture(self, testdir):
        """
        When the fixture is used in a test, it should be cleaned when the test
        function is marked to be cleaned. The container passed to the test
        function should be running.
        """
        testdir.makeconftest("""
            from seaworthy.definitions import ContainerDefinition
            from seaworthy.pytest.fixtures import clean_container_fixtures


            class CleanableContainer(ContainerDefinition):
                def __init__(self):
                    super().__init__(name='test', image='{}')
                    self.cleaned = False

                def clean(self):
                    self.cleaned = True

                def was_cleaned(self):

                    cleaned = self.cleaned