~cjwatson/storm/move-tests

« back to all changes in this revision

Viewing changes to tests/databases/postgres.py

  • Committer: Colin Watson
  • Date: 2019-05-31 15:28:04 UTC
  • mfrom: (487.2.2 py3-exceptions)
  • Revision ID: cjwatson@canonical.com-20190531152804-jk4ykojm7k1fvjtf
Use Python 3-friendly "except" syntax. [r=simpoir]

Show diffs side-by-side

added added

removed removed

Lines of Context:
741
741
        self.connection._raw_connection = FakeConnection()
742
742
        try:
743
743
            self.connection.rollback()
744
 
        except Exception, exc:
 
744
        except Exception as exc:
745
745
            self.fail('Exception should have been swallowed: %s' % repr(exc))
746
746
 
747
747
 
875
875
        self.remaining_time = 0.001
876
876
        try:
877
877
            self.connection.execute(statement)
878
 
        except TimeoutError, e:
 
878
        except TimeoutError as e:
879
879
            self.assertEqual("SQL server cancelled statement", e.message)
880
880
            self.assertEqual(statement, e.statement)
881
881
            self.assertEqual((), e.params)