Esempio n. 1
0
 def test_warn_not_expected(self):
     with ShouldAssert("sequence not as expected:\n\n"
                       "same:\n[]\n\n"
                       "expected:\n[]\n\n"
                       "actual:\n[UserWarning('foo'" + comma + ")]"):
         with warnings.catch_warnings(record=True) as backstop:
             with ShouldNotWarn():
                 warnings.warn('foo')
     compare(len(backstop), expected=0)
Esempio n. 2
0
 def test_no_warn_expected(self):
     with ShouldNotWarn():
         pass