Skip to main content

Pytest multihost plugin

Project description

[!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.

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"])

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

pytest_mh-1.0.19.tar.gz (74.6 kB view details)

Uploaded Source

Built Distribution

pytest_mh-1.0.19-py3-none-any.whl (91.0 kB view details)

Uploaded Python 3

File details

Details for the file pytest_mh-1.0.19.tar.gz.

File metadata

  • Download URL: pytest_mh-1.0.19.tar.gz
  • Upload date:
  • Size: 74.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for pytest_mh-1.0.19.tar.gz
Algorithm Hash digest
SHA256 bc9a55d2cc5331ea1191d70199c87eb5440c50ee5c0d0abf952ea94a8b10824c
MD5 a1150f88d7e97c7e0fa62f52dbbb37c1
BLAKE2b-256 8a6fd91a3531a28cb381681eea7fc47cd54c05441a1fad0080848960cdb13367

See more details on using hashes here.

File details

Details for the file pytest_mh-1.0.19-py3-none-any.whl.

File metadata

  • Download URL: pytest_mh-1.0.19-py3-none-any.whl
  • Upload date:
  • Size: 91.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for pytest_mh-1.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 691496235202bef2223f7bda32cc3a3b8fcbad4ef1c744dba1fed0ad57c78484
MD5 71f75f0591c78d2b46af791223c2e51b
BLAKE2b-256 364c332f9ff8f9b65253a9ccf9dae2ff2cd130b621afb3a73e76558f108589ae

See more details on using hashes here.

Supported by

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