{"id":21891237,"url":"https://github.com/deathbeds/sweet","last_synced_at":"2026-04-17T19:02:13.643Z","repository":{"id":75802890,"uuid":"128544920","full_name":"deathbeds/sweet","owner":"deathbeds","description":"Testing for interactive programming","archived":false,"fork":false,"pushed_at":"2018-04-09T01:26:14.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T03:12:46.926Z","etag":null,"topics":["doctest","hypothesis","ipython","jupyter","testing","unittest"],"latest_commit_sha":null,"homepage":"https://mybinder.org/v2/gh/deathbeds/sweet/master?filepath=readme.ipynb","language":"Jupyter Notebook","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/deathbeds.png","metadata":{"files":{"readme":"readme.ipynb","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":"2018-04-07T16:02:56.000Z","updated_at":"2020-06-06T07:32:49.000Z","dependencies_parsed_at":"2023-03-20T12:26:01.287Z","dependency_job_id":null,"html_url":"https://github.com/deathbeds/sweet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deathbeds/sweet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathbeds%2Fsweet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathbeds%2Fsweet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathbeds%2Fsweet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathbeds%2Fsweet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deathbeds","download_url":"https://codeload.github.com/deathbeds/sweet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathbeds%2Fsweet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31941845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["doctest","hypothesis","ipython","jupyter","testing","unittest"],"created_at":"2024-11-28T12:23:41.780Z","updated_at":"2026-04-17T19:02:13.618Z","avatar_url":"https://github.com/deathbeds.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# testing and typing is __Sweet__\\n\",\n    \"    \\n\",\n    \"[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/deathbeds/sweet/master?filepath=readme.ipynb) \\n\",\n    \"   \\n\",\n    \"__Sweet__ is an easy way to test interactive code. It combines unittest, doctest, and hypothesis to promoting better code health.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"    if __name__ == '__main__':\\n\",\n    \"        %reload_ext sweet\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"Because creating a function or class should do more than create a name.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"\u003csweet.test.Result run=2 errors=0 failures=0\u003e\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"    def test_no_params():\\n\",\n    \"        \\\"\\\"\\\"This function is tested because it has no parameters.  It is executed using FunctionTestCase\\n\",\n    \"\\n\",\n    \"        \u003e\u003e\u003e assert True\\n\",\n    \"\\n\",\n    \"        The docstring is also tested.\\n\",\n    \"        \\\"\\\"\\\"\\n\",\n    \"        assert True\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"\u003csweet.test.Result run=1 errors=0 failures=0\u003e\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"    ct = 0\\n\",\n    \"    def when_there_are_annotations(x: int):\\n\",\n    \"        global ct\\n\",\n    \"        ct +=1\\n\",\n    \"        return x\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"\u003csweet.test.Result run=1 errors=0 failures=0\u003e\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"    def after_hypothesis():\\n\",\n    \"        global ct\\n\",\n    \"        assert ct \u003e 0\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Interactive typing \\n\",\n    \"\\n\",\n    \"Using [__monkeytype__]()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"The sweet.typing extension is already loaded. To reload it, use:\\n\",\n      \"  %reload_ext sweet.typing\\n\"\n     ]\n    },\n    {\n     \"data\": {\n      \"text/plain\": [\n       \"from pandas.core.frame import DataFrame\\n\",\n       \"from typing import Union\\n\",\n       \"\\n\",\n       \"\\n\",\n       \"def after_hypothesis() -\u003e None: ...\\n\",\n       \"\\n\",\n       \"\\n\",\n       \"def f(x: Union[float, DataFrame, str, int]) -\u003e str: ...\"\n      ]\n     },\n     \"execution_count\": 7,\n     \"metadata\": {},\n     \"output_type\": \"execute_result\"\n    }\n   ],\n   \"source\": [\n    \"    %load_ext sweet.typing\\n\",\n    \"    def f(x):\\n\",\n    \"        return str(x)\\n\",\n    \"    %typing\\n\",\n    \"    f(10)\\n\",\n    \"    f(10.)\\n\",\n    \"    f('asdf')\\n\",\n    \"    f(__import__('pandas').util.testing.makeDataFrame())\\n\",\n    \"    after_hypothesis()\\n\",\n    \"    %typing readme.pyi\\n\",\n    \"    __import__('IPython').display.Pretty(filename='readme.pyi')\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Developer.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 8,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[NbConvertApp] Converting notebook readme.ipynb to markdown\\n\",\n      \"[NbConvertApp] Writing 2016 bytes to readme.md\\n\",\n      \"The readme shows the \u003csweet.test.Result run=4 errors=0 failures=0\u003e\\n\",\n      \"and the source shows the \u003csweet.test.Result run=4 errors=0 failures=0\u003e\\n\",\n      \"🏆\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"    if __name__ == '__main__':\\n\",\n    \"        !jupyter nbconvert --to markdown readme.ipynb\\n\",\n    \"        from sweet import Sweet\\n\",\n    \"        result = Sweet().run()\\n\",\n    \"        print(f\\\"\\\"\\\"The readme shows the {result}\\\"\\\"\\\")\\n\",\n    \"        print(f\\\"\\\"\\\"and the source shows the {Sweet(module='sweet').run(result)}\\\"\\\"\\\")\\n\",\n    \"        print(\\\"🏆\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": []\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"p6\",\n   \"language\": \"python\",\n   \"name\": \"other-env\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.6.3\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeathbeds%2Fsweet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeathbeds%2Fsweet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeathbeds%2Fsweet/lists"}