In this pytest tutorial, you'll learn how to monkey patch global variables.
First, we create the first part of a Python pipeline, which collects files.
Secondly, we try to test the implemented function without monkey patching the global variable pointing to the data directory.
Last but not least, I'll show you how you can monkey patch this global variable to use a temporary directory and get the test pass.
The code used in this video can be found on GitHub