{"id":19946107,"url":"https://github.com/quantco/pytest-action","last_synced_at":"2025-10-27T23:37:20.125Z","repository":{"id":221418694,"uuid":"509115418","full_name":"Quantco/pytest-action","owner":"Quantco","description":":octocat: GitHub Action to run pytest with GitHub Job Summaries support :snake: :rocket:","archived":false,"fork":false,"pushed_at":"2024-12-16T23:22:04.000Z","size":184,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-01T14:16:12.534Z","etag":null,"topics":["infrastructure"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quantco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-30T14:33:29.000Z","updated_at":"2025-01-14T11:26:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"412a025a-8782-4b04-b89b-d98a96eb053d","html_url":"https://github.com/Quantco/pytest-action","commit_stats":null,"previous_names":["quantco/pytest-action"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Quantco/pytest-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpytest-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpytest-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpytest-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpytest-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quantco","download_url":"https://codeload.github.com/Quantco/pytest-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpytest-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281361402,"owners_count":26487881,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["infrastructure"],"created_at":"2024-11-13T00:28:19.840Z","updated_at":"2025-10-27T23:37:20.095Z","avatar_url":"https://github.com/Quantco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Action for pytest\n\nThis GitHub Action allows you to run `pytest` and output [GitHub Job Summaries](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/). For creating the job summaries, this action uses [`pytest-md`](https://github.com/hackebrot/pytest-md) and [`pytest-emoji`](https://github.com/hackebrot/pytest-emoji).\n\n```yml\n- name: Run pytest\n  uses: quantco/pytest-action@v2\n  with:\n    verbose: true\n    emoji: true\n    job-summary: true\n    custom-arguments: '-q'\n    click-to-expand: true\n    report-title: 'Test Report'\n```\n\nYou need to have Python as well as `pytest` installed in your pipeline before you can run this action. If `job-summary` is set to `true`, you also need to install `pytest-md`. If `emoji` is set to `true`, you need to install `pytest-emoji`.\n\nWhen `job-summary` is set to `true`, the action will output a Job Summary.\n\n![Example Job Summary](./.github/assets/summary-example-light.png#gh-light-mode-only)\n![Example Job Summary](./.github/assets/summary-example-dark.png#gh-dark-mode-only)\n\n\u003c!-- action-docs-inputs --\u003e\n## Inputs\n\n| parameter | description | required | default |\n| --- | --- | --- | --- |\n| job-summary | Print a GitHub job summary | `false` | true |\n| verbose | Verbose output | `false` | true |\n| emoji | Use emojis in the output | `false` | true |\n| custom-arguments | Custom arguments to pass to pytest | `false` |  |\n| custom-pytest | Custom command to replace the `pytest` call. Can be a custom executable or something like `poetry run pytest` or `micromamba run -n myenv pytest`. | `false` | pytest |\n| report-title | Title of the report | `false` | Test Report |\n| click-to-expand | Add 'Click to expand' to the report | `false` | true |\n\u003c!-- action-docs-inputs --\u003e\n\n## Setting time zone\n\nIf you want to change the time zone of the job summary, you may want to use the [szenius/set-timezone](https://github.com/marketplace/actions/set-timezone) action:\n```yml\n- name: Set timezone\n  uses: szenius/set-timezone@ce9c440bc3af4f51b28d7ef7e5c47ee8f26c8dcb\n  with:\n    timezone: 'Europe/Berlin'\n```\n\n## Activating `conda` environments\n\nThis action uses `bash -l {0}` as the shell to run `pytest` in, \ni.e., the login shell that also sources your `.bash_profile`. \nWhen using `bash` in GitHub Actions, it doesn't source your `.bash_profile` by default. \nIf you want to use a `conda` environment, you need to make sure to add it into your `.bash_profile` s.t. \nthe `conda` environment automatically gets activated. \n[mamba-org/setup-micromamba](https://github.com/mamba-org/setup-micromamba) \ndoes this automatically for you.\n\n```yml\n- uses: mamba-org/setup-micromamba@v1\n  with:\n    environment-name: myenv\n    create-args: \u003e-\n      python=3.11\n      pytest\n      numpy\n      pytest-md\n      pytest-emoji\n# first checkout and then use the action because dependabot crashes when it sees private repositories\n- name: Checkout quantco/pytest-action\n  uses: actions/checkout@v3\n  with:\n    repository: quantco/pytest-action\n    ref: v2\n    token: ${{ secrets.FQ_GH_TOKEN }}\n    path: .github/pytest-action\n- name: Run unittests\n  uses: ./.github/pytest-action\n```\n\n## Example Usage\n\n```yml\nname: Run Python tests\n\non: [push]\n\njobs:\n  build:\n    name: Run tests\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        python-version: [\"3.6\", \"3.7\", \"3.8\", \"3.9\"]\n\n    steps:\n      - uses: szenius/set-timezone@ce9c440bc3af4f51b28d7ef7e5c47ee8f26c8dcb\n        with:\n          timezoneLinux: \"Europe/Berlin\"\n      - uses: actions/checkout@v3\n      - name: Set up Python ${{ matrix.python-version }}\n        uses: actions/setup-python@v4\n        with:\n          python-version: ${{ matrix.python-version }}\n      - name: Install dependencies\n        run: pip install pytest pytest-md pytest-emoji\n      # first checkout and then use the action because dependabot crashes when it sees private repositories\n      - name: Checkout quantco/pytest-action\n        uses: actions/checkout@v3\n        with:\n          repository: quantco/pytest-action\n          ref: v2\n          token: ${{ secrets.FQ_GH_TOKEN }}\n          path: .github/pytest-action\n      - name: Run unittests\n        uses: ./.github/pytest-action\n        with:\n          emoji: false\n          verbose: false\n          job-summary: true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantco%2Fpytest-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantco%2Fpytest-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantco%2Fpytest-action/lists"}