Posts
Fatalement
Cancel

How to mock function without typing to not use type ignore

Import only for mypy an internal module If you need to import a module only for mypy, and do not want to create a circular dependency, you can do like that: 1 2 3 4 5 6 7 8 from typing import TYPE...

How to use cache to install python lib with Gitlab CI

If you have a CI process with multiple job that needs to install the same libraries, it can be very time consuming. So you probably want to use a cache to not download each those libraries that you...

Lolcommits

Few months ago, I discovered this really funny repo: lolcommits. It will take a picture of you each time you are making a commit. This is really fun to see how your evolution accross month. How to...

Mock and how to test the arguments

In the case you need to check the parameters with a mock was called. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 from mock import patch @patch('the_function_I_want_to_mock') def test_vanilla_...

My favourite and most useful alias

A few years ago, I discovered this really nice library called youtube-dl. This library allows you to download video from youtube and other platforms. Here is my alias to only download the mp3 and p...