Based on this question and its answers: What is an applicable approach (if there is any) of blocking network access of a test or process on Travis CI?
Background: I want to test offline functionality, i.e. a cache, enabling to use a library without internet/network access. A dependency (a third-party piece of software) involved in the process tries to connect to the internet/network. Currently, I am managing to prohibit its internet/network access (confirmed locally by “pulling the plug”), though I want to find a way to implement a proper CI test for long-term maintenance. Most of the testing infrastructure is written in Python and based on pytest.