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

Uploaded Source

Built Distribution

pytest_mh-1.0.20-py3-none-any.whl (92.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytest_mh-1.0.20.tar.gz
Algorithm Hash digest
SHA256 acb073b493a50fca62c904656a09fb92ada8cd258319369a545026d732d6bc50
MD5 0239a10144ca6437d629a5bc565e92dc
BLAKE2b-256 8bb43943534d00769887b9d92ae1bc836ef13ce9417cb70c24306355c96748dc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pytest_mh-1.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 3e9d1e01b414d74f6caf882997c713d97cd9962dbe824745d7335487cab1108a
MD5 0b2e4c8d0d7ab3eceaebcdbcf7d892df
BLAKE2b-256 216ad9bff7bd980ab61ae8b798483aa2a56e353b3d375e3a7385943f32ebf607

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