Open pnijhara opened 3 years ago
Hi @pnijhara!
Thank you for raising this point! Indeed, the syntax you propose is completely equivalent and working. However, I find the former more readable: for developers discovering the code of this fixture, it's more obvious that we are first opening a context for the lifespan events, then another one for the HTTP client.
Therefore, I think we can keep it like this; it's not harmful IMO.
Yeah, I agree with you it is more readable. However, for the sake of others, I request you to keep this discussion open. Maybe someone finds this worthy.
Although the
with
statements mentioned below are written in tests, they can be merged. I am not very much sure about this but we can have a discussion on it.this can reframed as:
Similarly in
chapter9/chapter9_app_post_test.py
,chapter9/chapter9_app_test.py
,chapter9/chapter9_db_test.py
. There could be other collapsablewith
statements that could be merged that I haven't looked.