pixell icon indicating copy to clipboard operation
pixell copied to clipboard

Add unit tests: get to at least 70% coverage

Open msyriac opened this issue 7 years ago • 0 comments

The test framework for this repository is py.test. It's very easy to write unit tests. Simply add any function that starts with test_ to any script that starts with test_ anywhere in this repository (but preferentially in the tests/ directory) that has a assert statements in it which evaluate to False if something bad happens.

Example

tests/test_math.py


def test_add():
    assert 2+2==4

Of course, the more non-trivial and clever the test, the better. Once this has been done, you can run

py.test

from the repo root directory to run the tests. These tests will also be run every time code is pushed.

msyriac avatar Sep 17 '18 02:09 msyriac