You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deftest_set_option_consistency() ->None:
""" When set_option changes an option value, get_option should return the new option value. Returns ------- None """original=cl.options.ARRAY_BACKENDtry:
cl.options.set_option('ARRAY_BACKEND', 'sparse')
assertcl.options.ARRAY_BACKEND=='sparse'assertcl.options.get_option('ARRAY_BACKEND') =='sparse'finally:
# Reset the options to default if the test fails.cl.options.set_option('ARRAY_BACKEND', original)
We have a method called Options.reset_option, which resets all options, but not individually. This requires an extra line, original = cl.options.ARRAY_BACKEND, to extract ARRAY_BACKEND and then reset it after the test.
We can remove this by allowing individual options to be reset, such as:
Activity