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

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.29.tar.gz (79.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_mh-1.0.29-py3-none-any.whl (96.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_mh-1.0.29.tar.gz
  • Upload date:
  • Size: 79.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytest_mh-1.0.29.tar.gz
Algorithm Hash digest
SHA256 48845faab7dd0f7b7cb37be35075dd8696fd1aaedd990713e113af89aa3d608e
MD5 e67f9a1e8c03210c04c9b5777416b196
BLAKE2b-256 5603fdbca5788d30b4e76f311fb631e5908d3803f373f11ec54c92ffc42ed8bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_mh-1.0.29-py3-none-any.whl
  • Upload date:
  • Size: 96.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytest_mh-1.0.29-py3-none-any.whl
Algorithm Hash digest
SHA256 6ce4ece23581a3295321b49130b82cb05ba1199646ca579a920a757c876917b4
MD5 4f060ea937c6d03cb1cee71e9ee8e183
BLAKE2b-256 a906e1f6c834453ee3de836cc31b08f4e4ffdc039c1c0f80fa16f7055fd5fccf

See more details on using hashes here.

Supported by

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