1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
import requests def test_fetch_data(): result = "" for part in ["a", "b"]: result += part try: requests.get("https://example.com") except Exception: pass print(result) assert result == "ab"