Pytest Mocking

  1. Pytest: Mocking - why?
  2. Pytest: Mocking - what?
  3. Pytest: What is Mocking? - Test Doubles
  4. Pytest: Monkey Patching
  5. Pytest: Hard-coded path
  6. Pytest: Hard-coded path - manually replace attribute
  7. Pytest: Hard-coded path - monkeypatch attribute
  8. Pytest: Hard-coded path - monkeypatch attribute - tempdir
  9. Pytest: Mocking slow external API call
  10. Pytest: Mocking slow external API call - manually replace function
  11. Pytest: Mocking slow external API call - manually replace function - broken remote
  12. Pytest: Mocking slow external API call - monkeypatch
  13. Pytest: Mocking STDIN
  14. Pytest: Mocking STDIN manually mocking
  15. Pytest: Mocking STDIN - monkeypatch
  16. Pytest: Mocking random numbes - the application
  17. Pytest: Mocking random numbes
  18. Pytest: Mocking multiple random numbers
  19. Pytest: Mocking environment variables
  20. Pytest: Mocking time
  21. Pytest: Mocking time (test expiration)
  22. Pytest: mocking specific timestamp with datetime
  23. Pytest: mocking specific timestamp with datetime
  24. Pytest: mocking datetime.date.today
  25. Pytest: mocking datetime date
  26. Pytest: One dimensional spacefight
  27. Pytest: Mocking input and output in the game
  28. Pytest: Mocking input and output in the game - no tools
  29. Pytest: Mocking random in the game
  30. Pytest: Mocking random in the game - no tools
  31. Pytest: Flask app sending mail
  32. Pytest: Mocking Flask app sending mail
  33. Pytest: Mocking - collecting stats example