johnwmillr / LyricsGenius

Download song lyrics and metadata from Genius.com 🎶🎤
http://www.johnwmillr.com/scraping-genius-lyrics/
MIT License
892 stars 158 forks source link

Migrate tests to Pytest #205

Open allerter opened 3 years ago

allerter commented 3 years ago

Currently, the unit tests use Python's standard library unittest, but this library is limited in features and doesn't allow for much modularity. The solution is to use pytest. instead, as many other open-source packages do. Also, migrating the tests wouldn't be that hard as pytest already supports tests written for unittest. But we should change the structure of the tests nonetheless to utilize pytest's features. This would allow us to add tests easily later on. For example, instead of importing the Genius object from tests/__init__.py we should make the object a fixture declared in tests/conftest.py and rewrite the tests accordingly.