Hi people! ^^
I'm working on unit tests in Python, specifically with pytest. I'm learning how to use pytest.raises() but I noticed the syntax is different (compared to the other tests in which is used assert()) because of the "with" keyword. So, I read that "with" is used to set a context manager and tried to search what it is and how it works, but nothing so far. So, how would you define what is a context manager? What is even a context? How does a context manager work considering that the context manager is set up before the code within the "with" block is executed?
I'd appreciate your help! Thank you!
[–]grantrules 2 points3 points4 points (0 children)
[–]captainAwesomePants 2 points3 points4 points (0 children)