Skip to main content

Test Docker container images

Project description

https://img.shields.io/pypi/v/seaworthy.svg https://readthedocs.org/projects/seaworthy/badge/?version=latest https://travis-ci.org/praekeltfoundation/seaworthy.svg?branch=develop https://codecov.io/gh/praekeltfoundation/seaworthy/branch/develop/graph/badge.svg

Seaworthy is a test harness for Docker container images. It allows you to use Docker containers and other Docker resources as fixtures for tests written in Python.

Seaworthy supports Python 3.4 and newer. You can find more information in the documentation.

Quick demo

First install Seaworthy along with pytest using pip:

pip install seaworthy[pytest]

Write some tests in a file, for example, test_echo_container.py:

from seaworthy.definitions import ContainerDefinition
from seaworthy.pytest.fixtures import resource_fixture

container = ContainerDefinition(
    'echo', 'jmalloc/echo-server',
    wait_patterns=[r'Echo server listening on port 8080'],
    create_kwargs={'ports': {'8080': None}})
fixture = resource_fixture(container, 'echo_container')


def test_echo(echo_container):
    r = echo_container.http_client().get('/foo')
    assert r.status_code == 200
    assert 'HTTP/1.1 GET /foo' in r.text

Run pytest:

pytest -v test_echo_container.py

Project status

Seaworthy should be considered alpha-level software. It is well-tested and works well for the first few things we have used it for, but we would like to use it for more of our Docker projects, which may require some parts of Seaworthy to evolve further. See the project issues for known issues/shortcomings.

The project was originally split out of the tests we wrote for our docker-django-bootstrap project. There are examples of Seaworthy in use there.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seaworthy-0.1.0.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

seaworthy-0.1.0-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

Details for the file seaworthy-0.1.0.tar.gz.

File metadata

  • Download URL: seaworthy-0.1.0.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for seaworthy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4ae7e8dd095c376ca3d0141c8789eef2e4e8f31b99c81a089dada18b1fa5f6c9
MD5 288cd10d03d53fe283e3deefb8a604ff
BLAKE2b-256 13b602680ba3ab77bc395eb6e3d73d0d8173589781853aa91d14c9246ec611cc

See more details on using hashes here.

File details

Details for the file seaworthy-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for seaworthy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb1658aacde61cdeeaac007732fc0f07867f2d1702866d0eb48ff4bb164cd273
MD5 87e6a29b7239d22eb4519e25344006fa
BLAKE2b-256 b058ee0b34524b451f016086305e92b01d12312bd5f14c697998bbe724465177

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page