Skip to content

Commit

Permalink
Try postgres with sqlalch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
seanh committed Oct 4, 2015
1 parent 4bec397 commit 9dfd050
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# use Travis container build infrastructure
sudo: required
services:
- docker
sudo: false
addons:
postgresql: "9.4"
language:
- python
python:
- '2.7'
before_install:
- docker pull postgres
- sudo service docker restart ; sleep 10
- docker run -d --name postgres -p 5433:5432 -e POSTGRES_PASSWORD=pass postgres
install:
- gem install compass
- pip install -U pip wheel
- pip install coveralls pyramid_redis_sessions
- npm install
- make
before_script:
- psql -c 'create database htest;' -U postgres
script:
# Run all tests, with coverage if possible
- make cover
Expand Down
2 changes: 1 addition & 1 deletion conf/test.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[app:main]
use: egg:h

sqlalchemy.url: postgresql://postgres:pass@localhost:5433/postgres
sqlalchemy.url: postgresql://postgres@localhost/htest

webassets.base_dir: h:static
webassets.base_url: assets
Expand Down
2 changes: 1 addition & 1 deletion conf/testext.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[app:main]
use: egg:h

sqlalchemy.url: postgresql://postgres:pass@localhost:5433/postgres
sqlalchemy.url: postgresql://postgres@localhost/htest

h.hashids.salt: test salt

Expand Down
2 changes: 2 additions & 0 deletions h/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from sqlalchemy import engine_from_config
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
import transaction

from zope.sqlalchemy import ZopeTransactionExtension

Expand Down Expand Up @@ -62,6 +63,7 @@ def bind_engine(engine,
session.configure(bind=engine)
base.metadata.bind = engine
if should_drop:
transaction.commit()
base.metadata.drop_all(engine)
if should_create:
base.metadata.create_all(engine)
Expand Down

0 comments on commit 9dfd050

Please sign in to comment.