Move deprecation warnings into test fixture

@cpennington if you please
I don't think `cleanUp` is used by `unittest`. Instead, use the line `self.addCleanup(self.cws.__exit__)` to your `setUp`.