Lines Matching refs:wmod
602 wmod = self.module
603 orig_filters = wmod.filters
604 orig_showwarning = wmod.showwarning
606 with wmod.catch_warnings(module=wmod, record=True):
607 wmod.filters = wmod.showwarning = object()
608 self.assertTrue(wmod.filters is orig_filters)
609 self.assertTrue(wmod.showwarning is orig_showwarning)
611 with wmod.catch_warnings(module=wmod, record=False):
612 wmod.filters = wmod.showwarning = object()
613 self.assertTrue(wmod.filters is orig_filters)
614 self.assertTrue(wmod.showwarning is orig_showwarning)
617 wmod = self.module
619 with wmod.catch_warnings(module=wmod, record=True) as w:
622 wmod.simplefilter("always")
623 wmod.warn("foo")
625 wmod.warn("bar")
632 orig_showwarning = wmod.showwarning
633 with wmod.catch_warnings(module=wmod, record=False) as w:
635 self.assertTrue(wmod.showwarning is orig_showwarning)
638 wmod = self.module
640 x = wmod.catch_warnings(module=wmod, record=True)
645 x = wmod.catch_warnings(module=wmod, record=False)
651 wmod = self.module
652 orig_filters = wmod.filters
653 orig_showwarning = wmod.showwarning
655 with wmod.catch_warnings(module=wmod) as w:
657 self.assertTrue(wmod.showwarning is orig_showwarning)
658 self.assertTrue(wmod.filters is not orig_filters)
659 self.assertTrue(wmod.filters is orig_filters)
660 if wmod is sys.modules['warnings']:
662 with wmod.catch_warnings() as w:
664 self.assertTrue(wmod.showwarning is orig_showwarning)
665 self.assertTrue(wmod.filters is not orig_filters)
666 self.assertTrue(wmod.filters is orig_filters)
670 wmod = self.module
671 if wmod is not sys.modules['warnings']:
675 wmod.simplefilter("always")
676 wmod.warn("foo")
678 wmod.warn("bar")
689 wmod.warn("foo")
697 wmod.warn("foo")