Code for Life Community
  • ๐Ÿ’›Welcome
  • ๐Ÿ“…Release Notes
  • โค๏ธBecome a Contributor
  • ๐ŸชดIndustry Experience
  • ๐Ÿ†Wall of Fame
  • ๐Ÿ“ฆRepositories and Packages
  • ๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟNational Curriculum alignment
  • ๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟNational Curriculum alignment
  • โ„น๏ธGlossary
  • COMMUNICATIONS
    • ๐Ÿ“–Publications
  • ๐Ÿ—ž๏ธNewsletters
    • ๐ŸŽŠSpring 2025
    • ๐ŸŒทBett show 2025
    • ๐ŸŽ„December 2024
    • ๐ŸAutumn 2024
    • ๐ŸŒปSummer 2024
    • ๐ŸฐSpring 2024
    • โ„๏ธWinter 2024
    • ๐ŸŽ„December 2023
    • ๐ŸAutumn 2023
    • ๐ŸŒปSummer 2023
    • ๐ŸŒทSpring 2023
    • ๐ŸŽ„December 2022
    • ๐ŸAutumn 2022
    • ๐ŸŒปSummer 2022
    • ๐ŸŒทSpring 2022
    • ๐ŸŽ„December 2021
  • ๐ŸงฉNewsletter challenges
    • ๐Ÿค–Ocado Robot Debugging Challenge!
  • ๐Ÿค–Books of Robots
  • Community resource hub
    • ๐Ÿ’ปHow do Computers work?
    • ๐Ÿ”Safety online: Passwords and Security
    • ๐Ÿค–The World of Robotics
    • ๐ŸฆพCareers in technology
      • ๐Ÿ“ƒCareers posters
      • ๐Ÿ“ฝ๏ธCareer based videos
  • Software Developer Guide
    • ๐Ÿ’ปDev Environment Setup
    • ๐Ÿ”Code Promotion Strategy
    • ๐Ÿ’ฟBack End
      • โ„น๏ธOverview
      • โœ๏ธCoding Patterns
      • ๐ŸงชTesting Strategy
    • ๐Ÿ–ฑ๏ธFront End
      • โ„น๏ธOverview
      • โœ๏ธCoding Patterns
      • ๐ŸงชTesting Strategy
  • Links
    • Code Workspace
    • Visit our Site
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Software Developer Guide
  2. Back End

Testing Strategy

How we test our back end

PreviousCoding PatternsNextFront End

Last updated 11 months ago

Was this helpful?

When a PR is submitted, a series of tests will be run with Github actions. It is fine to just submit your PR and let the tests run on Github. However, if the tests fail, you may need to run the tests locally to investigate what's going on, then either fix the tests, or fix your code.

Running Python Tests Locally

To run Python tests, simply run at the top folder of the repository:

pytest -n auto

The pytest command will run both the tests written with and those with the built-in python .

We are aiming to migrate all unittest to pytest. Meanwhile you will see a combination of these. If you write new tests, please use pytest.

For Rapid Router and Portal, pytest also runs . Check the section below for what you need to install to run it.

The Python tests in Portal also include some snapshot tests. Running pytest will also automatically run the snapshot tests. When needed, the snapshot tests can be updated by running pytest --snapshot-update.

๐Ÿ’ฟ
๐Ÿงช
pytest
unittest
Selenium tests