Use new doctest setup/teardown

issue3627
review7401002