Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

Commit

Permalink
silent migration
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekziade committed Feb 28, 2017
1 parent e6b82b8 commit a6f43a5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions serviceweb/tests/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import time
from http.client import HTTPConnection
import signal
import sys
from io import StringIO

import yaml
import requests_mock
Expand Down Expand Up @@ -53,7 +55,7 @@ def _run():
start = time.time()
connected = False

while time.time() - start < 5 and not connected:
while time.time() - start < 10 and not connected:
try:
conn = HTTPConnection('localhost', 8888)
conn.request("GET", "/api/")
Expand Down Expand Up @@ -84,7 +86,14 @@ def setUp(self):
shutil.copyfile(_DB, _DB + '.saved')
shutil.copyfile(_BOOK, _BOOK + '.saved')
try:
self._migrate(_DB)
old_stdout = sys.stdout
old_stderr = sys.stderr
sys.stderr = sys.stdout = StringIO()
try:
self._migrate(_DB)
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr

with open(_BOOK) as f:
new_content = f.read() % {'DB': _DB}
Expand Down

0 comments on commit a6f43a5

Please sign in to comment.