Skip to main content

Pytest multihost plugin

Project description

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

Uploaded Source

Built Distribution

pytest_mh-1.0.7-py3-none-any.whl (52.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_mh-1.0.7.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pytest_mh-1.0.7.tar.gz
Algorithm Hash digest
SHA256 b27f2039454ae58e6ef90f3b74145b422f691356aa8078f5fd948b91f270c7c2
MD5 5cb45971097f68b17e9dc8bd595d6274
BLAKE2b-256 c50992d82df20b5f90027027e62332928826ffe58d3e946983912c5dfb87d772

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_mh-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 52.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pytest_mh-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b23c90a331bd7e9711476afe94f6fe9ebb181326bd6126d696123be657b7e943
MD5 41e108bece65518e4179fd404559a779
BLAKE2b-256 3230905f7fcdbba2c08522e7919e44c733f335ed8f4b73caeea9943ab9ef263a

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