{"id":22057266,"url":"https://github.com/fair2-for-research-software/python-testing-for-research","last_synced_at":"2025-03-23T16:24:32.563Z","repository":{"id":226593109,"uuid":"769125719","full_name":"FAIR2-for-research-software/python-testing-for-research","owner":"FAIR2-for-research-software","description":"A training course on the practical use of tests in research software.","archived":false,"fork":false,"pushed_at":"2025-02-05T16:41:11.000Z","size":6539,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T17:29:27.738Z","etag":null,"topics":["ci","continuous-integration","english","fair","fair4rs","lesson","pre-alpha","python","python-testing","research","research-software","rse","software","software-testing","testing","unit-testing","unit-tests"],"latest_commit_sha":null,"homepage":"https://fair2-for-research-software.github.io/python-testing-for-research/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FAIR2-for-research-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2024-03-08T11:54:34.000Z","updated_at":"2025-02-05T16:41:16.000Z","dependencies_parsed_at":"2024-04-30T02:26:29.621Z","dependency_job_id":"c3e187b2-0b1f-4eb3-8970-da4f731881cb","html_url":"https://github.com/FAIR2-for-research-software/python-testing-for-research","commit_stats":null,"previous_names":["sylviawhittle/python-testing-for-research","fair2-for-research-software/python-testing-for-research"],"tags_count":0,"template":false,"template_full_name":"carpentries/workbench-template-md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FAIR2-for-research-software%2Fpython-testing-for-research","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FAIR2-for-research-software%2Fpython-testing-for-research/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FAIR2-for-research-software%2Fpython-testing-for-research/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FAIR2-for-research-software%2Fpython-testing-for-research/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FAIR2-for-research-software","download_url":"https://codeload.github.com/FAIR2-for-research-software/python-testing-for-research/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245129521,"owners_count":20565491,"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":["ci","continuous-integration","english","fair","fair4rs","lesson","pre-alpha","python","python-testing","research","research-software","rse","software","software-testing","testing","unit-testing","unit-tests"],"created_at":"2024-11-30T16:17:24.604Z","updated_at":"2025-03-23T16:24:32.505Z","avatar_url":"https://github.com/FAIR2-for-research-software.png","language":"Python","readme":"# Python testing for research\n\nA short course on the basics of software testing in Python using the `pytest` library.\n\nThis lesson uses [The Carpentries Workbench][workbench] template.\n\n## Course Description\n\nWhether you are a seasoned developer or just write the occasional script, it's important to know that your code does what you intend, and will continue to do so as you make changes.\n\nSoftware testing is a methodology of automatically ensuring that your code works correctly, without having to go back and manually verify after each change.\n\nThis course seeks to provide you with conceptual understanding and the tools you need to start ensuring the robustness of your code.\n\n### Contents\n\n- Basic tests\n- Running a test suite \u0026 understanding outputs\n- Best practices\n- Testing for errors\n- Testing data structures\n- Fixtures\n- Parametrisation\n- Testing file outputs\n- Continuous integration \u0026 automatic test-running with GitHub\n\n## Contributions\n\nContributions are welcome, please refer to the [contribution guidelines](CONTRIBUTING.md) of how to do so and ensure that you adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).\n\n### Build the lesson locally\n\nTo render the lesson locally, you will need to have [R][r] installed. Instructions for using R with the Carpentries template is [available](https://carpentries.github.io/workbench/#installation) but some additional setps have been taken to make sure the enivronment is reproducible using the [`{renv}`](https://rstudio.github.io/renv/articles/renv.html) package and an `renv.lockfile` is included which allows the environment to be re-created along with dependencies.\n\nAfter cloning the repository, you can set up the `renv` and install all packages with:\n``` r\nrenv::restore()\n# Optionally update packages\nrenv::update()\n```\nOnce you have installed the dependencies, you can render the pages locally by starting R in the project root and running:\n``` r\nsandpaper::serve()\n```\nThis will build the pages and start a local web-server in R and open it in your browser. These pages are \"live\" and will respond to local file changes if you save them.\n\n[git]: https://git-scm.com\n[r]: https://www.r-project.org/\n[workbench]: https://carpentries.github.io/workbench/\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffair2-for-research-software%2Fpython-testing-for-research","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffair2-for-research-software%2Fpython-testing-for-research","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffair2-for-research-software%2Fpython-testing-for-research/lists"}