{"id":30808413,"url":"https://github.com/kata198/goodtests","last_synced_at":"2025-09-06T03:12:01.605Z","repository":{"id":22265532,"uuid":"25599610","full_name":"kata198/GoodTests","owner":"kata198","description":"A fast python unit-testing framework which supports safe, encapsulated parallel execution of tests, unlike other frameworks which share states between tests, and intuitive setup/teardown methodology","archived":false,"fork":false,"pushed_at":"2023-07-05T23:33:56.000Z","size":161,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-31T19:58:58.137Z","etag":null,"topics":["assert","goodtests","parallel","python","test","unit","unit-test"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kata198.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","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":"2014-10-22T19:16:59.000Z","updated_at":"2023-04-24T05:02:03.000Z","dependencies_parsed_at":"2022-08-20T13:40:22.787Z","dependency_job_id":null,"html_url":"https://github.com/kata198/GoodTests","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/kata198/GoodTests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kata198%2FGoodTests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kata198%2FGoodTests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kata198%2FGoodTests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kata198%2FGoodTests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kata198","download_url":"https://codeload.github.com/kata198/GoodTests/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kata198%2FGoodTests/sbom","scorecard":{"id":551401,"data":{"date":"2025-08-11","repo":{"name":"github.com/kata198/GoodTests","commit":"be56785c2b8c716d1fdf2326c2e8950af8954799"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v2.1: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T10:58:52.238Z","repository_id":22265532,"created_at":"2025-08-20T10:58:52.238Z","updated_at":"2025-08-20T10:58:52.238Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273851321,"owners_count":25179413,"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-09-06T02:00:13.247Z","response_time":2576,"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":["assert","goodtests","parallel","python","test","unit","unit-test"],"created_at":"2025-09-06T03:12:00.279Z","updated_at":"2025-09-06T03:12:01.597Z","avatar_url":"https://github.com/kata198.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nGoodTests\n=========\nGoodTests is a fast python 2/3 compatible unit testing framework which I wrote to work around the shortcomings of other existing frameworks (like py.test and py unit test). It can serve as a drop-in replacement, without the need to modify any existing testcases (or very minimal modification).\n\nIt supports parallel execution, regular expression filtering, and provides class-level encapsulation such that a corrupted python environment (such as mocking out DB function calls and whatnot) does not propigate to other tests. This was one of the issues I had found in py.test. And teardown didn't get called if the test failed, so catching cleanup was impossible. It supports both setup/teardown for an entire class, and per method.\n\nEach class runs as a separate process, which can save a lot of time in data generation, and early failure prediction.\n\nSome Features:\n--------------\n\n*  It makes use of the \"assert\" keyword instead of other frameworks which have obtuse methods (like self.assertEquals)\n*  Colour output\n*  Because \"assert\" keyword is used, failures can have associated messages. e.x. assert len(items) == 2, 'Expected 2 items, got %d' %(len(items),)\n*  It supports running only methods that match a given regular expression.\n*  It supports discovery of all tests within a directory.\n*  Drop-in replacement for existing py.test/unit tests\n*  Tests extend \"object\". The tests themselves don't actually import any part of GoodTests.\n*  License is LGPL\n*  Supports python 2 and python 3.\n*  Runs tests in parallel\n*  Each test class (should have one per file) runs in the same process. This allows you to get more performance by not setting up and tearing down similar data for each function, and allows sharing of state and knowledge (like if test\\_constructor fails on a class, you know everything else is going to fail, so you can mark a flag \"self.xWillFail\" and assert at the beginning of functions.) Other advantages too\n*  Supports pdb mode (enabled via --pdb). See \"Interactive Debugging\" section below.\n\nGoodTests supports auto discovery of tests given a directory, by looking for files and classes that match the pattern (compatible with py.test)\n\nEach file should be in the form of test\\_$$CLASSNAME$$.py (where $$CLASSNAME$$ is the name, e.g. \"Magic\"). The class within the file should either be prefixed or suffixed with the word \"Test\" (e.g: \"TestMagic\" or \"MagicTest\").\n\nSupports old unit-test style (teardown\\_method and setup\\_method called for each method, and setup\\_class, teardown\\_class for each class) Also supports more modern forms, setup/teardown\\_[CLASSNAME] and setup/teardown\\_[METHOD]\n\nThe setup and teardown functions run REGARDLESS of whether the method itself was a success (contrary to some other unit testing frameworks).\n\nAssertions should use the \"assert\" keyword in python (example: assert 1 != 2)\n\nSee \"test\\_Magic.py\" for an example:\n\nUsage\n-----\n\n\tUsage:  GoodTests.py (options) [filesnames or directories]\n\n\t\tOptions:\n\n\t\t-n [number]              - Specifies number of simultaneous executions \n\t\t\t\t\t\t\t\t\t Default = # of processors (2).\n\t\t\t\t\t\t\t\t\tYou must use \"-n 1\" if using pdb\n\n\t\t--pdb                    - When an assertion fails, drop to a pdb shell within\n\t\t\t\t\t\t\t\t\t the test code at the point of failure  ( forces -n1 )\n\n\n\t\t-m [regexp]              - Run methods matching a specific pattern\n\n\t\t-q                       - Quiet (only print failures)\n\t\t\t\t\t\t\t\t\t  This will also disable stdout during test execution\n\n\t\t-t                       - Print extra timing information\n\n\n\t\t--no-colour              - Strip out colours from output\n\t\t--no-color\n\n\n\t\t--version                - Print version and copyright information\n\t\t--help                   - Show this message\n\n\n\nGoodTests can be used with -n to do multiple simultaneous executions (one process per test class)\n\n-m will use a regular expression pattern to execute only methods matching the name -q will only print failures\n\nGoodTests.py can be pointed toward any directory, and will load all files prefixed with test\\_ (example: test\\_Something.py)\n\nOutput will contain colours, and lists all the failures (or passes) as they happen, and a consolidated list at the end:\n\n\nInteractive Debugging (pdb)\n---------------------------\n\nGoodTests.py supports an \"interactive debugging\" mode, which is toggled by passing \"--pdb\" as an argument on the commandline.\n\nWhen in \"pdb mode\" or \"interactive debugging\" mode, if an AssertionError (failed assertion) is raised, or another uncaught Exception during test execution, the following will occur:\n\n* A pdb shell is started in the frame at which the exception was raised. So if you had an assertion that failed, the shell would drop you at that point in the code, allowing you to inspect variables, etc. to help diagnose why the failure occured and correct the situation.\n\n* Once you enter \"next\" [n] or \"continue\" [c], the setup (if any) will be ran again, and you will be dropped into a pdb interactive shell starting at the top of the test function. This will allow you to walk through the code, change variables, call functions, and print values to understand and attempt to correct the situation inline. If, during this session, you correct the issue and the formerly failing assertion now passes, it will be marked as \"PASS (debugger)\" in the results. The original Traceback will be printed in the aggregate summary at the bottom of test results, noting that it did pass upon retry due to actions executed during your debug session.\n\n\nYou may also choose to put a \"pdb.set\\_trace()\" directly within your test or code somewhere. In order for this to work, you must ensure that maxRunners == 1 ( i.e. pass \"-n1\" as an argument ).\n\n\nExample\n-------\n\nExample Test test\\_Magic.py:\n\n\timport os\n\n\tDO_PRINT = int(os.environ.get('DO_PRINT', 0))\n\n\tclass TestMagic(object):\n\n\t\tdef setup_TestMagic(self):\n\t\t\tif DO_PRINT:\n\t\t\t\tprint(\"Class Constructor\")\n\n\t\tdef setup_one(self):\n\t\t\tif DO_PRINT:\n\t\t\t\tprint(\"--Setting up one\")\n\n\t\tdef test_one(self):\n\t\t\tassert \"one\" != \"magic\"\n\t\t\tassert \"magic\" == \"magic\"\n\n\t\tdef teardown_one(self):\n\t\t\tif DO_PRINT:\n\t\t\t\tprint(\"--Tearing Down One\")\n\n\n\t\tdef test_WillFail(self):\n\t\t\tassert 2 == 3, 'Expected two to equal three'\n\n\t\tdef test_popularity(self):\n\t\t\ttim = 'abcsdfsd'\n\t\t\tcool = 'abcsdfsd'\n\t\t\tassert tim is cool\n\n\t\tdef teardown_WillFail(self):\n\t\t\tif DO_PRINT:\n\t\t\t\tprint(\"--Tearing Down Will Fail\")\n\n\nResults:\n\n\t$ GoodTests.py test\\_Magic.py\n\n\ttest_Magic.py - TestMagic.test_WillFail FAIL *****Assertion Error*****\n\tTraceback (most recent call last):\n\t\tFile \"/home/media/work/github/GoodTests/test_Magic.py\", line 25, in test_WillFail\n\t\tassert 2 == 3\n\tAssertionError: Expected two to equal three\n\n\ttest_Magic.py - TestMagic.test_one PASS\n\ttest_Magic.py - TestMagic.test_popularity PASS\n\n\n\t==================================================\n\tSummary:\n\n\tTest results (2 of 3 PASS) Took 0.000650 total seconds to run.\n\n\n\tFailing Tests:\n\ttest_Magic.py (1 FAILED):\n\t\tTestMagic (1 FAILED):\n\t\t\ttest_WillFail -\n\t\t\tTraceback (most recent call last):\n\t\t\t\tFile \"/home/media/work/github/GoodTests/test_Magic.py\", line 25, in test_WillFail\n\t\t\t\tassert 2 == 3\n\t\t\tAssertionError: Expected two to equal three\n\n\n\n\t==================================================\n\tSummary:\n\n\tTest results (2 of 3 PASS) Took 0.006250 total seconds to run.\n\n\nIncluding In Project\n--------------------\n\nI recommend bundling the provided \"distrib/runTests.py\" with your projects to support GoodTests.\n\nrunTests.py will download the latest GoodTests.py into the local directory if it is not installed, and will ensure the local copy of source is used when running tests, which saves the step of running \"setup.py install\" each change to run tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkata198%2Fgoodtests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkata198%2Fgoodtests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkata198%2Fgoodtests/lists"}