{"id":15472077,"url":"https://github.com/encukou/pytest-level","last_synced_at":"2025-06-25T05:05:17.862Z","repository":{"id":62584108,"uuid":"177585837","full_name":"encukou/pytest-level","owner":"encukou","description":null,"archived":false,"fork":false,"pushed_at":"2020-05-29T14:42:40.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-20T12:16:47.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/encukou.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":"2019-03-25T12:52:23.000Z","updated_at":"2023-11-23T03:53:12.000Z","dependencies_parsed_at":"2022-11-03T22:16:34.382Z","dependency_job_id":null,"html_url":"https://github.com/encukou/pytest-level","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/encukou/pytest-level","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encukou%2Fpytest-level","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encukou%2Fpytest-level/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encukou%2Fpytest-level/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encukou%2Fpytest-level/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/encukou","download_url":"https://codeload.github.com/encukou/pytest-level/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encukou%2Fpytest-level/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261601480,"owners_count":23183092,"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":[],"created_at":"2024-10-02T02:26:00.774Z","updated_at":"2025-06-25T05:05:17.840Z","avatar_url":"https://github.com/encukou.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytest-level\n\nMark test cases with a *level*, then de-select tests with a given level or higher.\n\nWhen giving a teaching/practice assignment with pre-written tests, either all\ntests can be given at once (leaving students overwhelmed and unsure which\nfailures should be fixed next), or piece-wise (in individual files -- which\nbecomes a mess for larger projects).\n\nWith this plugin, tests for a teaching/practice assignment can be given in\na single file. Students are then told to run with `--level 1`, fix the few red\ntests, then go to `--level 2`, etc.\nUnlike with keywords, all the lower-level tests will still be run:\n`--level 2` will run both `level(1)` and `level(2)` tests.\n\n\n## Installation\n\nIn a Python environment (e.g. `venv`), do:\n\n    python -m pip install pytest-level\n\n\n## Usage\n\nMark tests with a numeric `level` marker:\n\n    @pytest.mark.level(1)\n    def test_basic_math():\n        assert 1 + 1 == 2\n\n    @pytest.mark.level(2)\n    def test_intermediate_math():\n        assert 10 / 2 == 5\n\n    @pytest.mark.level(3)\n    def test_complicated_math():\n        assert 10 ** 3 == 1000\n\nThen, run pytest with `--level`:\n\n    python -m pytest --level 2\n\nThis will deselect tests of a higher level.\n\nWithout `--level`, all tests are run.\n\n\n## Licence\n\nThe code is available under a MIT license. May it serve you well.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fencukou%2Fpytest-level","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fencukou%2Fpytest-level","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fencukou%2Fpytest-level/lists"}