Use 'mock_open' to be compatible with python3 (and also it's better)