Skip to main content
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.

A demo repository is available with a set of Seaworthy tests for a simple Django application. Seaworthy is also introduced in our blog post on continuous integration with Docker on Travis CI.

For more background on the design and purpose of Seaworthy, see our PyConZA 2018 talk (slides).

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

container = ContainerDefinition(
    'echo', 'jmalloc/echo-server',
    wait_patterns=[r'Echo server listening on port 8080'],
    create_kwargs={'ports': {'8080': None}})
fixture = container.pytest_fixture('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.

Metadata

Release files for seaworthy 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seaworthy 0.4.2
File Size Uploaded
seaworthy-0.4.2.tar.gz 46.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for seaworthy 0.4.2
File Interpreter ABI Platform
seaworthy-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 105.2 kB

Release files / seaworthy-0.4.2.tar.gz

Download URL seaworthy-0.4.2.tar.gz
Size 46.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2d9161e70bccea65220cf4026761eef49135d41fc704c2236ad3226d6a936598
BLAKE2b-256 checksum
How to use checksums
6f2bf6e069e187d8bd1fd6da9a86295f04037804f8e98b5da176588ea445559a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.1

Release files / seaworthy-0.4.2-py3-none-any.whl

Download URL seaworthy-0.4.2-py3-none-any.whl
Size 58.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84b7a1884778b1e96e5d42b64078659974fe370936f88cc19965674ed1518781
BLAKE2b-256 checksum
How to use checksums
13cd37cbcf46651c75f5a7f12808e44ad01eeb5f9f475a426e24e0898be735fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page