{"id":28334139,"url":"https://github.com/junnyyy/python-unit-tests","last_synced_at":"2025-10-10T02:04:48.368Z","repository":{"id":222221949,"uuid":"756611673","full_name":"Junnyyy/Python-Unit-Tests","owner":"Junnyyy","description":"Python Unit Test Example","archived":false,"fork":false,"pushed_at":"2024-02-16T03:52:43.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T13:32:10.654Z","etag":null,"topics":["python","testing","unit-testing","unittest"],"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/Junnyyy.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-13T00:15:16.000Z","updated_at":"2024-02-13T00:18:35.000Z","dependencies_parsed_at":"2024-02-13T02:28:10.183Z","dependency_job_id":"22517c49-f630-485f-887e-1b796d63de14","html_url":"https://github.com/Junnyyy/Python-Unit-Tests","commit_stats":null,"previous_names":["junnyyy/python-unit-tests"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Junnyyy/Python-Unit-Tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Junnyyy%2FPython-Unit-Tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Junnyyy%2FPython-Unit-Tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Junnyyy%2FPython-Unit-Tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Junnyyy%2FPython-Unit-Tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Junnyyy","download_url":"https://codeload.github.com/Junnyyy/Python-Unit-Tests/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Junnyyy%2FPython-Unit-Tests/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002523,"owners_count":26083399,"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-10T02:00:06.843Z","response_time":62,"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":["python","testing","unit-testing","unittest"],"created_at":"2025-05-26T20:59:08.944Z","updated_at":"2025-10-10T02:04:48.361Z","avatar_url":"https://github.com/Junnyyy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Unit Testing Example\n\nThis is a simple example of how to use Python's built-in `unittest` module to write and run unit tests.\n\nInterleave string solution is from my own Leetcode [submission](https://leetcode.com/problems/interleaving-string/submissions/856314608).\n\n## Quick Start\n\n- To run the tests and downloaded required packages:\n\n```bash\nsh build.sh\n```\n\n- Example of Canary and regular tests are in `./tests/interleave_tests.py`\n- Expected result is\n\n```bash\nRan 5 tests in 0.000s\n\nOK\n```\n\n## Structure\n\n- `build.sh`: This script installs required pip packages and runs the tests using \"python3.\"\n- `requirements.txt`: This file is used by pip to install packages. If you require any packages, you can add them here.\n- `src`: This directory contains your source files, i.e., your code.\n- `tests`: All your tests are located here.\n\n## Testing\n\n`unittest` is the preinstalled Python testing library. There are alternatives you may consider, such as Pytest. Running the test is as simple as:\n\n```bash\npython -m unittest [directory]\n```\n\nIf you prefer a more verbose output, add `-v`:\n\n```bash\npython -m unittest -v [directory]\n```\n\n## Packages\n\nFor most, pip is your go-to for packages. For those coming from JavaScript, there isn't a `package.json`; the alternative is `requirements.txt`. You can include any required packages in this file, and anyone using pip can install them simply.\n\nExample `requirements.txt`:\n\n```makefile\npip==22.3.1\nwheel==0.38.4\nPillow==9.5.0\nsetuptools==65.5.1\npackaging==23.1\nnumpy==1.26.0\n```\n\nTo install the packages, it is as simple as:\n\n```bash\npip install -r requirements.txt\n```\n\n---\n\nHave fun! If you find a mistake or an improvement, please drop a pull request and let me know!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunnyyy%2Fpython-unit-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunnyyy%2Fpython-unit-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunnyyy%2Fpython-unit-tests/lists"}