{"id":20619554,"url":"https://github.com/shearichard/python-unittest-sandbox","last_synced_at":"2025-06-11T14:03:08.568Z","repository":{"id":145202412,"uuid":"392855493","full_name":"shearichard/python-unittest-sandbox","owner":"shearichard","description":"Illustration of using python unittest","archived":false,"fork":false,"pushed_at":"2021-08-05T02:54:59.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T08:08:00.560Z","etag":null,"topics":["python-3","python3","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/shearichard.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,"publiccode":null,"codemeta":null}},"created_at":"2021-08-05T00:11:42.000Z","updated_at":"2021-08-05T02:55:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"26b37328-8a35-4362-b773-8e20578f27b2","html_url":"https://github.com/shearichard/python-unittest-sandbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shearichard%2Fpython-unittest-sandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shearichard%2Fpython-unittest-sandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shearichard%2Fpython-unittest-sandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shearichard%2Fpython-unittest-sandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shearichard","download_url":"https://codeload.github.com/shearichard/python-unittest-sandbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shearichard%2Fpython-unittest-sandbox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259279283,"owners_count":22833410,"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":["python-3","python3","testing","unittest"],"created_at":"2024-11-16T12:11:59.214Z","updated_at":"2025-06-11T14:03:08.521Z","avatar_url":"https://github.com/shearichard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Unittest Sandbox\nThis project is used to demonstrate how the Python [unittest](https://docs.python.org/3/library/unittest.html) module may be used.\n\nTested against Python 3.7 on Ubuntu 20.x\n\n## Environmental Concerns\n\nThis project makes use of [Pipenv](https://pipenv.pypa.io/en/latest/) although as it doesn't use any module outside of this project and the python standard library you should be able to make use of it anywhere where python 3.x is found. \n\n## Invoking tests\n\nThere are two modules of interest. \n\n### module_framework_illustrator\n\n`module_framework_illustrator`, outputs text to illustrate the order in which different elements of a unittest based module execute. This module is significantly based on a blog post I found but cannot now re-find so I'm sorry I can't credit the author but I am grateful. If you'd like to get in touch I will be happy to provide a credit - just raise an issue on this repository.\n\nThis module may be invoked as follows.\n```\npython -m module_framework_illustrator\n```\n\nThe expected output is \n\n```\n(python-unittest-sandbox) rshea@foobar:~/src/python-unittest-sandbox/pyunsa$ python -m  module_framework_illustration\nsetUpModule: __main__ set up A\n\n    setUpClass: TestCase1 set up B\n\n        setUp: __main__.TestCase1.test_one set up C\n\n            __main__.TestCase1.test_one running\n\n        tearDown: __main__.TestCase1.test_one tear down C\n\n.        setUp: __main__.TestCase1.test_two set up C\n\n            __main__.TestCase1.test_two running\n\n        tearDown: __main__.TestCase1.test_two tear down C\n\n.    tearDownClass: TestCase1 tear down B\n\nsetUpModule: __main__ tear down A\n\n\n----------------------------------------------------------------------\nRan 2 tests in 0.013s\n\nOK\n```\n\n\n### module\n\nA more real-world illustration of how tests are structured exists in `module.py` and may be invoked as follows.\n\n```\npython -m module\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshearichard%2Fpython-unittest-sandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshearichard%2Fpython-unittest-sandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshearichard%2Fpython-unittest-sandbox/lists"}