Posts
Fatalement
Cancel

Decorator and Structlog

During the Python web summit organized by Geekle.us, I listened to an interesting talk about Structlog library. I decided to play a bit with it and with decorators, I implemented a small project ab...

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_...