Merge pull request #1634 from mdboom/doctest/units

doctest/units
Simplify context managers for enabling units.
Fix doc warning