Skip to content

Instantly share code, notes, and snippets.

View romuald's full-sized avatar
🍣

Romuald Brunet romuald

🍣
View GitHub Profile
@romuald
romuald / nosy_patch.py
Last active February 22, 2023 10:05
Python "pass-through" patch recipe
"""
This is a simple "pass-through" patch recipe for python testing
Allows to check if a method was called during testing
For example:
```
with nosy_patch('package.inner_method') as mock:
package.outter_method()
@romuald
romuald / dcsv.py
Created August 5, 2025 09:45
A simple snippet that can be used to read CSV files with headers
"""
A simple snippet that can be used to read CSV files with headers
"""
import csv
from contextlib import contextmanager
@contextmanager
def dcsv(filename):
with open(filename) as reader: