def test_clean_restores_config(self):
     old = logging.root
     mgr = LoggingResourceManager()
     res = mgr.make({})
     mgr.clean(res)
     self.assertEqual(old, logging.root)
     self.assertLoggingManagerAndRootConnected()
 def test_always_dirty(self):
     mgr = LoggingResourceManager()
     self.assertTrue(mgr.isDirty())
     self.assertTrue(mgr._dirty)
 def test_make_nukes_config(self):
     mgr = LoggingResourceManager()
     res = mgr.make({})
     self.addCleanup(mgr.clean, res)
     self.assertIsInstance(logging.root, logging.RootLogger)
     self.assertLoggingManagerAndRootConnected()