{"id":19512501,"url":"https://github.com/vberlier/pytest-minecraft","last_synced_at":"2025-07-14T08:32:36.614Z","repository":{"id":48595043,"uuid":"291841503","full_name":"vberlier/pytest-minecraft","owner":"vberlier","description":"A pytest plugin for running tests against Minecraft releases.","archived":false,"fork":false,"pushed_at":"2022-04-06T00:47:41.000Z","size":197,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T02:20:05.686Z","etag":null,"topics":["datapack","minecraft","pytest-plugin","resourcepack","testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vberlier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-31T22:52:08.000Z","updated_at":"2025-05-28T20:41:57.000Z","dependencies_parsed_at":"2022-08-27T21:23:43.310Z","dependency_job_id":null,"html_url":"https://github.com/vberlier/pytest-minecraft","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vberlier/pytest-minecraft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fpytest-minecraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fpytest-minecraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fpytest-minecraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fpytest-minecraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vberlier","download_url":"https://codeload.github.com/vberlier/pytest-minecraft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fpytest-minecraft/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262599,"owners_count":23736427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datapack","minecraft","pytest-plugin","resourcepack","testing"],"created_at":"2024-11-10T23:26:25.558Z","updated_at":"2025-07-14T08:32:36.578Z","avatar_url":"https://github.com/vberlier.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytest-minecraft\n\n[![Build Status](https://travis-ci.com/vberlier/pytest-minecraft.svg?branch=master)](https://travis-ci.com/vberlier/pytest-minecraft)\n[![PyPI](https://img.shields.io/pypi/v/pytest-minecraft.svg)](https://pypi.org/project/pytest-minecraft/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytest-minecraft.svg)](https://pypi.org/project/pytest-minecraft/)\n\n\u003e A pytest plugin for running tests against Minecraft releases.\n\nThe plugin automatically downloads the latest version of the Minecraft client into the pytest cache. The provided fixtures can also extract the vanilla [resource pack](https://minecraft.gamepedia.com/Resource_Pack) and [data pack](https://minecraft.gamepedia.com/Data_Pack) on demand.\n\n## Installation\n\nThe package can be installed with `pip`.\n\n```bash\n$ pip install pytest-minecraft\n```\n\n## Usage\n\nDownloading the Minecraft client takes a few seconds so the tests that use the fixtures provided by the plugin will be skipped unless explicitly enabled with a command-line flag. The `--minecraft-latest` flag will enable the tests and run them against the latest stable release.\n\n```sh\n$ pytest --minecraft-latest\n```\n\nYou can also use the `--minecraft-snapshot` flag to test against the latest snapshot. Both flags can be specified at the same time to run the tests against both stable and snapshot releases.\n\n```sh\n$ pytest --minecraft-latest --minecraft-snapshot\n```\n\n### Fixtures\n\n- The `minecraft_client_jar` fixture returns the path to the downloaded Minecraft client as a [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path) instance.\n\n  ```python\n  def test_with_client(minecraft_client_jar):\n      assert minecraft_client_jar.name == \"client.jar\"\n\n      with ZipFile(minecraft_client_jar) as client:\n          assert len(client.namelist()) \u003e 10_000\n  ```\n\n- The `minecraft_resource_pack` fixture returns the path to the extracted vanilla resource pack as a [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path) instance.\n\n  ```python\n  def test_with_resource_pack(minecraft_resource_pack):\n      assert minecraft_resource_pack.name == \"resource_pack\"\n      assert (minecraft_resource_pack / \"assets\" / \"minecraft\" / \"textures\").is_dir()\n  ```\n\n- The `minecraft_data_pack` fixture returns the path to the extracted vanilla data pack as a [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path) instance.\n\n  ```python\n  def test_with_data_pack(minecraft_data_pack):\n      assert minecraft_data_pack.name == \"data_pack\"\n      assert (minecraft_data_pack / \"data\" / \"minecraft\" / \"loot_tables\").is_dir()\n  ```\n\n## Contributing\n\nContributions are welcome. This project uses [`poetry`](https://python-poetry.org/).\n\n```sh\n$ poetry install\n```\n\nYou can run the tests with `poetry run pytest`.\n\n```sh\n$ poetry run pytest\n```\n\nThe code follows the [black](https://github.com/psf/black) code style.\n\n```sh\n$ poetry run black .\n```\n\n---\n\nLicense - [MIT](https://github.com/vberlier/pytest-minecraft/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvberlier%2Fpytest-minecraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvberlier%2Fpytest-minecraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvberlier%2Fpytest-minecraft/lists"}