This diff adds a build_resource method on top of build_resources. Most users will only ever have to use the build_resources API(s) for testing the initialization and fxnality of their resources. For these users, it is annoying to have to boilerplate out the creation of a Resources context object, and then get the resource off of that object. This provides a nice interface for those use cases.
can we add a test for a context manager based resource? what happens? does it just silently not tear down ?
It makes sense to have nice APIs for the simple common case - but I think we should be intentional about what the behavior is when these get used with the complex rare case. I am suspect that just ignoring it is what we want
This discussion may be more appropriate to settle on the diff below
When you say ignoring, do you mean ignoring the cm-based resource? That makes sense to me, but then we need some way of determining that something is or isn't a context manager, which might be tricky.
When you say ignoring, do you mean ignoring the cm-based resource? That makes sense to me,
to clarify my position - I doubt that silently not running tear down for a CM resource is what we want to do
but then we need some way of determining that something is or isn't a context manager, which might be tricky.
its just about threading the information around