              self.assertRaises(Exception, lambda: ops.spatial_version)
  
      def test_no_version_number(self):
          ops = FakePostGISOperations()
          self.assertRaises(ImproperlyConfigured, lambda: ops.spatial_version)
 
</s> remove             self.assertRaises(Exception, lambda: ops.spatial_version)
 </s> add             with self.assertRaises(Exception):
                ops.spatial_version </s> remove         self.assertRaises(ImproperlyConfigured, lambda: reverse('account:register'))
 </s> add         with self.assertRaises(ImproperlyConfigured):
            reverse('account:register') </s> remove             self.assertRaises(NoReverseMatch, lambda: reverse('second'))
 </s> add             with self.assertRaises(NoReverseMatch):
                reverse('second') </s> remove         self.assertRaises(NoReverseMatch, lambda: reverse('first'))
        self.assertRaises(NoReverseMatch, lambda: reverse('second'))
 </s> add         with self.assertRaises(NoReverseMatch):
            reverse('first')
        with self.assertRaises(NoReverseMatch):
            reverse('second') </s> remove         self.assertRaises(NoReverseMatch, lambda: reverse('first'))
        self.assertRaises(NoReverseMatch, lambda: reverse('second'))
 </s> add         with self.assertRaises(NoReverseMatch):
            reverse('first')
        with self.assertRaises(NoReverseMatch):
            reverse('second')
        with self.assertRaises(ImproperlyConfigured):
            ops.spatial_version
              self.assertRaises(Exception, lambda: ops.spatial_version)
  
      def test_no_version_number(self):
          ops = FakePostGISOperations()
        with self.assertRaises(ImproperlyConfigured):
            ops.spatial_version
keep keep keep keep replace
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/tests.py