Skip to content

Commit

Permalink
fix #57
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyq0826 committed Apr 9, 2018
1 parent 09b1aa7 commit ab9c59e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
@@ -1,6 +1,14 @@
app-turbo changes log
=====================

## 0.4.8

- Support Python3.4, Python3.5, Python3.6

## 0.4.7

- Support turbo in Python 2.7 install correctly

## 0.4.5

- Methods `get_as_column`,`create`, attribute `column` are removed from `BaseModel` class
Expand Down
8 changes: 2 additions & 6 deletions tests/app_test.py
Expand Up @@ -11,7 +11,7 @@
from turbo.conf import app_config
from turbo.util import basestring_type as basestring

from util import unittest, port_is_used
from util import unittest, port_is_used, get_free_tcp_port

app_config.app_name = 'app_test'
app_config.web_application_setting = {
Expand Down Expand Up @@ -116,11 +116,7 @@ def run_server(port):


def setUpModule():
port = 8888
while True:
if not port_is_used(port):
break
port += 1
port = get_free_tcp_port()
server = multiprocessing.Process(target=run_server, args=(port,))
server.start()
global PID, URL
Expand Down
8 changes: 8 additions & 0 deletions tests/util.py
Expand Up @@ -20,6 +20,14 @@ def port_is_used(port):
return False


def get_free_tcp_port():
tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
tcp.bind(('', 0))
addr, port = tcp.getsockname()
tcp.close()
return port


fake_ids = [
ObjectId('586a01b6ed80083a5087c7d7'),
ObjectId('586a01b6ed80083a5087c7d8'),
Expand Down

0 comments on commit ab9c59e

Please sign in to comment.