Add test_retry.py
Require pytest
Extract retry/api.py