Skip to main content

Pytest multihost plugin

Project description

pytest_mh - pytest multihost test framework

pytest-mh is a pytest plugin that, in its basics, allows you to run shell commands and scripts over SSH on remote Linux or Windows hosts. You want to use it to execute system or application tests for your project on remote host or hosts (or containers) while running pytest locally and thus 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.2.tar.gz (39.4 kB view details)

Uploaded Source

Built Distribution

pytest_mh-1.0.2-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_mh-1.0.2.tar.gz
  • Upload date:
  • Size: 39.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pytest_mh-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c781862cf110e1b42c25b64902628ec17c59aef374b9b6c23d5753a701ebd2e2
MD5 8333505a9bf95b57ae41e1b30dd962af
BLAKE2b-256 f9b6f8f40dc45ef05e33e254bc9cf38283077cd0a8376e72088db3c4fe3ab540

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_mh-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pytest_mh-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6aa96fd984b99f549423886145acd67af0dd4d42234e9c301ace664bf5f0c72c
MD5 0e3a6a8f3e74d64e9326a45b8cd0b8aa
BLAKE2b-256 84fc61a8ce2e22e992ea052c7a674196bc20d1f6d26a7e5007dbb206c2017dc7

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