-
Task
-
Resolution: Done
-
Normal
-
None
-
None
-
None
Write unit tests for listenbrainz stats module
_init_.py would be a good start for writing tests. SparkTestCase can be used as the base class.
Keep in mind the following:
- unit tests aim at testing functions independently. So write tests for all functions of the file you are testing.
- Data used in testing is mostly constant and should be destroyed as the tests end.
- every run of tests should give the same output.
- Refer to tests of listenbrainz_spark/utils for better understanding.
- A little knowledge of pyspark sql maybe required as you write the tests. Refer to the docs.
- We use pytest for testing. You can refer to the quick guide or the official documentation