Open danieldaeschle opened 6 years ago
Yep. Big fan of automated testing; is there an introduction to unit testing in Python you can recommend?
I don't know an introduction at the moment. But my default preferences are:
Install pytest for run tests with pytest
command
Install pytest-sugar for nicer output. Use pytest -p no:sguar
to run it with default output
tests
which includes:
conftest.py
import pytest
@pytest.fixture
def am():
return AmazonMusic(...)
my_test.py
def test_sth(am):
albums = am.list_albums()
assert len(albums) > 0
Here is the documentation
But to write tests, we have to insert credentials. This can be a little bit diffcult to solve...
Maybe after writing some tests you can add travis ci? :)