Convert tests to proper pytest