Playback starts YouTube’s embedded player (privacy-enhanced mode).
How to write readable tests
ChannelPyCon UKDescription from the creator
David Seddon
So often, our tests are much harder to understand than the rest of our code. This is a shame! Find out how to write tests that act as living documentation from which you can gain deeper understanding of your system.
Have you ever found yourself scratching your head when reading an automated test? Even if we take pride in our application code, it’s all too easy for us to neglect readability in our tests.
But tests can be more than just a safety net that nobody reads unless they break. In this talk, I’ll show you how to write Python tests that you will love, and keep coming back to.
Topics will include:
Showing what matters and hiding the rest
Don’t Repeat Yourself in tests, too
Using custom dataclasses
Arrange, Act, Assert
Telling a story
Showing your working
Sentinels
So often, our tests are much harder to understand than the rest of our code. This is a shame! Find out how to write tests that act as living documentation from which you can gain deeper understanding of your system.
Have you ever found yourself scratching your head when reading an automated test? Even if we take pride in our application code, it’s all too easy for us to neglect readability in our tests.
But tests can be more than just a safety net that nobody reads unless they break. In this talk, I’ll show you how to write Python tests that you will love, and keep coming back to.
Topics will include:
Showing what matters and hiding the rest
Don’t Repeat Yourself in tests, too
Using custom dataclasses
Arrange, Act, Assert
Telling a story
Showing your working
Sentinels
About this tutorial
PyCon UK published this 24:05 video tutorial on November 8, 2019. It has been watched 736 times on YouTube.
- Channel
- PyCon UK
- Category
- Science & Technology
- Duration
- 24:05
- Published
- November 8, 2019
- Views
- 736
- Likes
- 24
Tags
Share
This tutorial in other languages
- FRComment écrire des tests lisibles
- ESCómo escribir pruebas legibles
- PTComo escrever testes legíveis
- ITCome scrivere i test leggibili
- DEWie man lesbare Tests schreiben
- NLHoe te leesbaar tests te schrijven
- RUКак писать читаемые тесты
- PLJak napisać testy czytelne
- JA読み込み可能なテストを書く方法
- ARكيفية كتابة اختبارات للقراءة
- HIपठनीय परीक्षण लिखने के लिए कैसे
- IDBagaimana menulis tes dibaca