Improved testing with pytest

also added coverage