Assert on local instance of a mocked class - Python

I recently ran into the situation where I wanted to test something that was similar to this function:

Python function with requests.Session usage

Now, on the internet you can read plenty of text that says "you can't mock a local variable". While technically correct, this doesn't help a person who is trying to make assertions about the local instance of a mocked class.

Here is how to get the local instance of the mocked class: mock_session.return_value

Python test of function with requests.Session usage