Skip to main content

[!WARNING] This plugin is still actively developed and even though it is mostly stable, we reserve the right to introduce minor breaking changes if it is required for new functionality. Therefore we advise to pin pytest-mh version for your project.

pytest_mh - pytest multihost test framework

pytest-mh is a pytest plugin that, at a basic level, allows you to run shell commands and scripts over SSH on remote Linux or Windows hosts. You use it to execute system or application tests for your project on a remote host or hosts (or containers) while running pytest locally keeping your local machine intact.

The plugin also provides building blocks that can be used to setup and teardown your tests, perform automatic clean up of all changes done on the remote host, and build a flexible and unified high-level API to manipulate the hosts from your tests.

Documentation

See the full documentation here: https://pytest-mh.readthedocs.io.

Example usage

The following snippet was taken from the SSSD project.

    @pytest.mark.topology(KnownTopology.AD)
    @pytest.mark.topology(KnownTopology.LDAP)
    @pytest.mark.topology(KnownTopology.IPA)
    @pytest.mark.topology(KnownTopology.Samba)
    def test__id(client: Client, provider: GenericProvider):
        u = provider.user("tuser").add()
        provider.group("tgroup_1").add().add_member(u)
        provider.group("tgroup_2").add().add_member(u)

        client.sssd.start()
        result = client.tools.id("tuser")

        assert result is not None
        assert result.user.name == "tuser"
        assert result.memberof(["tgroup_1", "tgroup_2"])

Release files for pytest-mh 1.0.30

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

Source distribution (sdist)

Source distribution for pytest-mh 1.0.30
File Size Uploaded
pytest_mh-1.0.30.tar.gz 81.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-mh 1.0.30
File Interpreter ABI Platform
pytest_mh-1.0.30-py3-none-any.whl Python 3 none any Details

Total release size: 179.9 kB

Release files / pytest_mh-1.0.30.tar.gz

Download URL pytest_mh-1.0.30.tar.gz
Size 81.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f03488b7cd239a72beeed7e50027bbc1e1be45ef0a7ce3b19215ba4d9b6e8b46
BLAKE2b-256 checksum
How to use checksums
9774c0c4f83c577025b112735e003dfc8cb69557d4e655cfdbc5f6e774c7ca27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / pytest_mh-1.0.30-py3-none-any.whl

Download URL pytest_mh-1.0.30-py3-none-any.whl
Size 98.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c543a4ffd5b75c2b09258ebf33771293d66bf7690b31636c1be319b1b8e0e6b
BLAKE2b-256 checksum
How to use checksums
ad16dbd949edb8c68a11dadd76ed519e8bd067450679a0891f9ad3fb0e10fd76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.0.30 This release

2 release files

1.0.29

2 release files

1.0.28

2 release files

1.0.25

2 release files

1.0.24

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.19

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.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