Skip to content

Latest commit

 

History

History

tests

How to prepare to test your code?

This system of tests uses pytest

  1. Always write tests in the tests folder
  2. The name of your test script must start with test_ (this is default and can be changed but for sake of brevity we will let it be)
  3. Use the import statement to call your module
  4. Within your script (z.B. test_createSVG.py), declare a function that starts with test_*
  5. You may have as many functions you want but the ones that are to be tested should start with test_*
  6. Now call your module within the function by providing some dummy inputs
  7. Remember these inputs can be intentionally wrong or right
  8. Write assert statements to check if your input returns the correct result

How to run pytest on your code?

pytest tests/test_createSVG.py


How to run pytest on all the tests?

pytest tests/*