{"id":46574286,"url":"https://github.com/thoughtparametersllc/python-unit-testing","last_synced_at":"2026-03-07T09:22:35.372Z","repository":{"id":322573644,"uuid":"1090032205","full_name":"thoughtparametersllc/python-unit-testing","owner":"thoughtparametersllc","description":"Automate Pytest execution, track code coverage, and enforce quality gates. Ensure every Python release is reliable and bug-free.","archived":false,"fork":false,"pushed_at":"2025-12-19T06:45:21.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-22T02:03:24.588Z","etag":null,"topics":["coverage","git","github-actions","pytes","pytest-cov","python","python3","svg"],"latest_commit_sha":null,"homepage":"","language":null,"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/thoughtparametersllc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-05T06:08:58.000Z","updated_at":"2025-12-19T13:52:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thoughtparametersllc/python-unit-testing","commit_stats":null,"previous_names":["thoughtparametersllc/python-testing","thoughtparametersllc/python-unit-testing"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/thoughtparametersllc/python-unit-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtparametersllc%2Fpython-unit-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtparametersllc%2Fpython-unit-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtparametersllc%2Fpython-unit-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtparametersllc%2Fpython-unit-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoughtparametersllc","download_url":"https://codeload.github.com/thoughtparametersllc/python-unit-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtparametersllc%2Fpython-unit-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30210738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["coverage","git","github-actions","pytes","pytest-cov","python","python3","svg"],"created_at":"2026-03-07T09:22:34.675Z","updated_at":"2026-03-07T09:22:35.361Z","avatar_url":"https://github.com/thoughtparametersllc.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-unit-testing\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Python%20Unit%20Testing-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=github)](https://github.com/marketplace/actions/python-unit-testing)\n\nGitHub Action to run Python tests using pytest.\n\n## Features\n\n- 🐍 **pytest Testing** - Run pytest tests with configurable options\n- 📦 **Custom requirements** - Install additional dependencies from a requirements file\n- 📊 **Detailed reporting** - View test results in GitHub Actions summary\n- 🏷️ **SVG badge generation** - Automatically generate and commit testing badges to your repository\n- 🎯 **Framework-specific options** - Pass custom options to pytest\n\n## Supported Testing Framework\n\n| Framework  | Detection Method                   | Notes                                 |\n|------------|------------------------------------| --------------------------------------|\n| **pytest** | Always runs if pytest is installed | Most popular Python testing framework |\n\n## Usage\n\n\u003e **Note:** Until the first release is tagged, use a specific commit SHA (e.g., `@947908a`) instead of\n`@v1`. This ensures workflows continue to work even if development branches are deleted. Once v1.0.0 is\nreleased, you can use `@v1` for the latest v1.x version.\n\n### Basic Example\n\n```yaml\nname: Test\non: [push, pull_request]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      \n      - name: Run Python Tests\n        uses: thoughtparametersllc/python-unit-testing@v1  # or @\u003ccommit-sha\u003e before first release\n```\n\n### Advanced Example with All Options\n\n```yaml\nname: Test\non: [push, pull_request]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: write  # Required for badge commits\n    steps:\n      - uses: actions/checkout@v4\n      \n      - name: Run Python Tests\n        uses: thoughtparametersllc/python-unit-testing@v1\n        with:\n          python-version: '3.11'\n          requirements-file: 'requirements.txt'\n          pytest-options: '--cov --cov-report=xml'\n          commit-badges: 'true'\n          badges-directory: '.github/badges'\n```\n\n### With Badge Generation\n\nEnable badge generation to automatically create SVG badges for pytest:\n\n```yaml\n- name: Run Python Tests\n  uses: thoughtparametersllc/python-unit-testing@v1\n  with:\n    commit-badges: 'true'\n    badges-directory: '.github/badges'\n```\n\nWhen enabled, badges will show passing/failing status for pytest.\n\n**Note:** For badge commits to work, your workflow needs `contents: write` permission:\n\n```yaml\npermissions:\n  contents: write\n```\n\n## Inputs\n\n| Input                | Description                                           | Required | Default            |\n|----------------------|-------------------------------------------------------|----------|--------------------|\n| `python-version`     | Python version to use for testing                     | No       | `3.x`              |\n| `requirements-file`  | Path to requirements file for additional dependencies | No       | `requirements.txt` |\n| `pytest-options`     | Additional options to pass to pytest                  | No       | `''`               |\n| `commit-badges`      | Generate and commit SVG badges to the repository      | No       | `false`            |\n| `badges-directory`   | Directory where badge SVG files will be saved         | No       | `.github/badges`   |\n\n## How It Works\n\nThe action installs pytest and runs your tests with the specified options. You can:\n\n1. Specify a Python version to use\n2. Install additional requirements from a requirements file\n3. Pass custom options to pytest\n4. Generate SVG badges for test results\n5. Automatically commit badges to your repository\n\n## Examples\n\n### pytest Project with Coverage\n\n```yaml\n- uses: thoughtparametersllc/python-unit-testing@v1\n  with:\n    pytest-options: '--cov=mypackage --cov-report=xml'\n```\n\n### With Custom Requirements\n\n```yaml\n- uses: thoughtparametersllc/python-unit-testing@v1\n  with:\n    requirements-file: 'requirements-dev.txt'\n    pytest-options: '--verbose'\n```\n\n### With Badge Generation\n\n```yaml\n- uses: thoughtparametersllc/python-unit-testing@v1\n  with:\n    pytest-options: '--verbose'\n    commit-badges: 'true'\n```\n\n## Badge Display\n\nWhen `commit-badges` is enabled, you can manually add badge references to your README:\n\n```markdown\n# My Project\n\n![Pytest](.github/badges/pytest.svg)\n```\n\nThe badge will automatically update with passing/failing status after each test run.\n\n## Roadmap\n\nFuture enhancements planned:\n\n- **Additional frameworks** - Support for unittest, nose2, behave (BDD), tox, doctest\n- **Automatic README updates** - Auto-insert badge references in README\n- **Enhanced reporting** - Code coverage integration, test timing analysis\n- **Performance optimization** - Parallel test execution, dependency caching\n\n## Development\n\n### Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Ensure all tests pass\n5. Submit a pull request\n\n### Testing Locally\n\nYou can test the action locally by creating a test workflow in your repository.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Related Actions\n\n- [python-linting](https://github.com/thoughtparametersllc/python-linting) - Companion action for Python\n  linting with pylint, black, and mypy\n\n## Support\n\nIf you encounter any issues or have questions, please\n[open an issue](https://github.com/thoughtparametersllc/python-unit-testing/issues) on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtparametersllc%2Fpython-unit-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtparametersllc%2Fpython-unit-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtparametersllc%2Fpython-unit-testing/lists"}