Version 1.1

Vortrag: How to fake properly

Event large

Aiming at complete code coverage by unit tests tends to be cumbersome, especially for cases where external API calls a part of the code base. For these reasons, Python comes with the unittest.mock library, appearing to be a powerful companion in replacing parts of the system under test.

First and foremost, there will be a thorough discussion of the relevant use cases implemented in Python’s unittest.mock library. To move on, I will outline how this mocking functionality can be embedded in a pytest based test suite, amongst discussing the feasibility of replacing parts of the system under test. Eventually, I will discuss examples of production code unit tests that make use of the mock object library, thereby contributing to a solid understanding of the matter.


Tag: 04.05.2019
Anfang: 11:00
Dauer: 01:00
Raum: F4.22
Track: PyDays 2
Sprache: en




Uns interessiert deine Meinung! Wie fandest du diese Veranstaltung?

Concurrent Events