Closed pior closed 6 years ago
The only alternatives would be:
What about an having the "user" of this lib explicitly call a method to check the connection?
Silently checking a remote connection is a rather unusual practice.
We could add a keyword argument to disable testing on init (leave it on by default) and make the connection test method public.
That'd allow users to control when testing occurs during the lifecycle of their app if they know what they're doing, but by default it'd still be proactive about checking the connection for users out of the box.
I will try to find the time to ship a PR for that soon.
When instantiating a
OozieClient
, theurl
is checked by performing a request to Oozie.Code: https://github.com/Shopify/pyoozie/blob/master/pyoozie/client.py#L81
Constructors usually don't perform actual work, so it's counter-intuitive and can make testing harder than it should be.