tests: Migrate away from unittest to full pytest
Remove the use of unittest.TestCase
class.
Replace use of unittest assertions by pytest ones.
Use pytest autouse fixtures instead of setup/teardown methods.
Use tmpdir
fixture to manage temporary directories.