File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,19 @@ google-resumable-media==0.3.1 \
217
217
googleapis-common-protos==1.5.3 \
218
218
--hash=sha256:c075eddaa2628ab519e01b7d75b76e66c40eaa50fc52758d8225f84708950ef2
219
219
hiredis==0.2.0 \
220
- --hash=sha256:ca958e13128e49674aa4a96f02746f5de5973f39b57297b84d59fd44d314d5b5
220
+ --hash=sha256:013c4e31be95bd5d9e45a0f830743458249012dc1691b45b1710976c280074a0 \
221
+ --hash=sha256:0805bd9e98551bc904e487388c871c039878e5bf8fefed26b504dfe505ac91b4 \
222
+ --hash=sha256:09025bdda2a17294be015bccab7c1039ed41c95cdbef8915f27006c5204e656c \
223
+ --hash=sha256:3f8b334c59c474e2b92580d7f4fb6503a08c013ae8a877ffc5c252f899d90ac6 \
224
+ --hash=sha256:45887ded08a2e819123124b5cec4ec1c7e272a8c453d35fecb6d36e5b8c54717 \
225
+ --hash=sha256:587f56d987cfa9397362d2f772b34ea69e61637fc0093807525e94cb919aa027 \
226
+ --hash=sha256:71303245ea72cd85e72705ad237eb9d3847cdeff45f4ec81b0fa08ef4941610f \
227
+ --hash=sha256:7fd22790038ea983a5ecf8e77697906f59e9f781873cc8c9d6618bebeed7fb0c \
228
+ --hash=sha256:824e223a0e5a3a7b81025aa35075b4be5eec7251cebb3d305b092bc6f0beacaa \
229
+ --hash=sha256:bb2744c6026fa4dc4fb6b58d7b36d62ce3f669bb785956d1e3705b7bdbc23e3c \
230
+ --hash=sha256:c8a2d8d874b1cf6fb104a777846cfa22224f44ce3bef451ec4ae5160082825f7 \
231
+ --hash=sha256:ca958e13128e49674aa4a96f02746f5de5973f39b57297b84d59fd44d314d5b5 \
232
+ --hash=sha256:f69bffe7c1ad38be95bbb2c3e5c3f6f4eecb28b2f431a3c3e1532509eea89c92
221
233
html5lib==1.0.1 \
222
234
--hash=sha256:20b159aa3badc9d5ee8f5c647e5efd02ed2a66ab8d354930bd9ff139fc1dc0a3 \
223
235
--hash=sha256:66cb0dcfdbbc4f9c3ba1a63fdb511ffdbd4f513b2b6d81b80cd26ce6b3fb3736
Original file line number Diff line number Diff line change 21
21
import zope .sqlalchemy
22
22
23
23
from sqlalchemy import event
24
+ from sqlalchemy .exc import OperationalError
24
25
25
26
from warehouse import db
26
27
from warehouse .db import (
@@ -148,7 +149,7 @@ def test_creates_engine(monkeypatch):
148
149
149
150
def test_raises_db_available_error (pyramid_services , metrics ):
150
151
def raiser ():
151
- raise psycopg2 .OperationalError ()
152
+ raise OperationalError ( "foo" , {}, psycopg2 .OperationalError () )
152
153
153
154
engine = pretend .stub (connect = raiser )
154
155
request = pretend .stub (
Original file line number Diff line number Diff line change 23
23
24
24
from sqlalchemy import event , inspect
25
25
from sqlalchemy .dialects .postgresql import UUID
26
- from sqlalchemy .exc import IntegrityError
26
+ from sqlalchemy .exc import IntegrityError , OperationalError
27
27
from sqlalchemy .ext .declarative import declarative_base
28
28
from sqlalchemy .orm import sessionmaker
29
29
@@ -168,7 +168,7 @@ def _create_session(request):
168
168
# connections
169
169
try :
170
170
connection = request .registry ["sqlalchemy.engine" ].connect ()
171
- except psycopg2 . OperationalError :
171
+ except OperationalError :
172
172
# When we tried to connection to PostgreSQL, our database was not available for
173
173
# some reason. We're going to log it here and then raise our error. Most likely
174
174
# this is a transient error that will go away.
You can’t perform that action at this time.
0 commit comments