import pytest
This allows us to test that errors are raised and run pytest on our files.
'_test' or 'test_'
If you have pytest -k [insert key word here]
Pytest will search for files with that key word to run too
@pytest.mark.skip
This is a way to indicate to pytest that you want to skip over a particular test
@pytest.mark.xfail
This tells pytest that you are expecting this test to fail, so pytest will not collapse on you when you run it with this test
pylint [file name].py
Just need to have this installed on your local
Run this to lint over the code
This will check that docstrings exist at the top of every function
This also checks for unused variables to make our code shorter and a little more pythonic
coverage run -m pytest[test file name].py
coverage report -m
htmlcov
Just need to have this installed on your local
Run this to look at what percentage of your code your tests currently test
If you run the report or html as shown above you are able to look at what lines the test code is missing when you run pytest
This will generatecoverage html