Talk: Harry Percival - Stop Using Mocks (for a while)

  Рет қаралды 14,067

PyCon US

PyCon US

Күн бұрын

Пікірлер: 8
@manicdee983
@manicdee983 4 жыл бұрын
Sometimes the enterprisey-java-y stuff is actually useful :D You have teams of lazy programmers trying to manage separation of concerns (laziness, hubris and impatience being the three noble virtues). Also if you make the API a class, you can inject the dependency during startup or setup, so it doesn't pollute your API calls in the individual tests. Faking the entire 3rd party API becomes easier if your third party uses something like Swagger or OpenAPI. Failing that building the fake means you are deliberately learning how the third party API *actually* works instead of how it's *documented* to work, which is incredibly important. Then you can start doing things like adding assertions into your real API to check that the real API works the way you expected it to, with the error messages pointing out where your understanding is not in tune with reality. I'll certainly be checking out your book, though I don't think you mentioned it during the presentation.
@jonathanfmach2
@jonathanfmach2 2 жыл бұрын
Brilliant talk!
@harry__init__
@harry__init__ 4 жыл бұрын
some prior art: Ed Jung (tech reviewer for our book) on mocking + patching pitfalls from pycon last year: kzbin.info/www/bejne/gpXPq2eMYrp2fNk Yeray Diaz on dependency injection: "import as an antipattern" kzbin.info/www/bejne/p5yqqaxqmJtngMk Brandon Rhodes: "hoist your I/O" which is actually a radically different way of doing it, but it has the same objective of decoupling infra from business logic: kzbin.info/www/bejne/hnO0f2lopLqhhJo
@ailuros_
@ailuros_ 2 жыл бұрын
thanks!
@marco_gorelli
@marco_gorelli 4 жыл бұрын
OK, you've convinced me
@harry__init__
@harry__init__ 4 жыл бұрын
let me know how it goes!
Talk: Aly Sivji - If Statements are a Code Smell
30:38
PyCon US
Рет қаралды 13 М.
This mother's baby is too unreliable.
00:13
FUNNY XIAOTING 666
Рет қаралды 41 МЛН
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 343 М.
What's in the clown's bag? #clown #angel #bunnypolice
00:19
超人夫妇
Рет қаралды 24 МЛН
Talk: Anthony Shaw - Why is Python slow?
32:52
PyCon US
Рет қаралды 21 М.
Edwin Jung - Mocking and Patching Pitfalls - PyCon 2019
47:15
PyCon 2019
Рет қаралды 11 М.
Talk: Conor Hoekstra - Beautiful Python Refactoring
30:05
PyCon US
Рет қаралды 24 М.
Talk: Trey Hunner - Comprehensible Comprehensions
32:40
PyCon US
Рет қаралды 9 М.
Thoughts About Unit Testing | Prime Reacts
11:21
ThePrimeTime
Рет қаралды 228 М.
Stop Mocking, Start Testing
34:53
Next Day Video
Рет қаралды 44 М.
This mother's baby is too unreliable.
00:13
FUNNY XIAOTING 666
Рет қаралды 41 МЛН