Skip to content

Instantly share code, notes, and snippets.

@bepetersn
Created May 13, 2014 06:14
Show Gist options
  • Save bepetersn/e0274397f3ee214e0877 to your computer and use it in GitHub Desktop.
Save bepetersn/e0274397f3ee214e0877 to your computer and use it in GitHub Desktop.
test_pgsql_installation fails on the server, while apparently trying to load our actual database
============================= test session starts ==============================
platform linux2 -- Python 2.7.3 -- pytest-2.4.2
collected 16 items
tests/test_ccj_v1_0.py ..
tests/test_dpc_api.py ....
tests/test_dpc_model.py ....
tests/test_pgsql_installation.py F
tests/test_scraper.py ...
tests/test_summarize_daily_population.py ..
=================================== FAILURES ===================================
______________________________ test_db_available _______________________________
@pytest.mark.skipif(not ('CCJ_PRODUCTION' in os.environ and os.environ.get('CCJ_PRODUCTION') == '1'),
reason="Test must be run on Prodction server.")
def test_db_available():
> add_data()
tests/test_pgsql_installation.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def add_data():
# Declare a model
class ElaborateTest(db.Model):
id = db.Column(db.Integer, primary_key=True)
test_string = db.Column(db.String)
def __init__(self, test):
self.test_string = test
def __repr__(self):
return '<Test %r>' % self.test_string
# Add some new data to the DB
> db.create_all()
tests/test_pgsql_installation.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <SQLAlchemy engine='postgresql://cookcountyjail:walblgadb;lgall@localhost/cookcountyjail_v2_0_dev'>
bind = '__all__', app = None
def create_all(self, bind='__all__', app=None):
"""Creates all tables.
.. versionchanged:: 0.12
Parameters were added
"""
> self._execute_for_all_tables(app, bind, 'create_all')
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/flask_sqlalchemy/__init__.py:856:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <SQLAlchemy engine='postgresql://cookcountyjail:walblgadb;lgall@localhost/cookcountyjail_v2_0_dev'>
app = <Flask 'ccj.app'>, bind = None, operation = 'create_all'
def _execute_for_all_tables(self, app, bind, operation):
app = self.get_app(app)
if bind == '__all__':
binds = [None] + list(app.config.get('SQLALCHEMY_BINDS') or ())
elif isinstance(bind, basestring) or bind is None:
binds = [bind]
else:
binds = bind
for bind in binds:
tables = self.get_tables_for_bind(bind)
op = getattr(self.Model.metadata, operation)
> op(bind=self.get_engine(app, bind), tables=tables)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/flask_sqlalchemy/__init__.py:848:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = MetaData(bind=None)
bind = Engine(postgresql://cookcountyjail:***@localhost/cookcountyjail_v2_0_dev)
tables = [Table('court_building', MetaData(bind=None), Column('id', Integer(), table=<co...uilding>), Column('date_created', Da...n('id', Integer(), table=<charge>, p..., table=<charge>), Column('date_created', Date(), table=<charge>), schema=None)]
checkfirst = True
def create_all(self, bind=None, tables=None, checkfirst=True):
"""Create all tables stored in this metadata.
Conditional by default, will not attempt to recreate tables already
present in the target database.
:param bind:
A :class:`.Connectable` used to access the
database; if None, uses the existing bind on this ``MetaData``, if
any.
:param tables:
Optional list of ``Table`` objects, which is a subset of the total
tables in the ``MetaData`` (others are ignored).
:param checkfirst:
Defaults to True, don't issue CREATEs for tables already present
in the target database.
"""
if bind is None:
bind = _bind_or_error(self)
bind._run_visitor(ddl.SchemaGenerator,
self,
checkfirst=checkfirst,
> tables=tables)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/schema.py:2848:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Engine(postgresql://cookcountyjail:***@localhost/cookcountyjail_v2_0_dev)
visitorcallable = <class 'sqlalchemy.engine.ddl.SchemaGenerator'>
element = MetaData(bind=None), connection = None
kwargs = {'checkfirst': True, 'tables': [Table('court_building', MetaData(bind=None), Column('id', Integer(), table=<co...uildi...('id', Integer(), table=<charge>, p..., table=<charge>), Column('date_created', Date(), table=<charge>), schema=None)]}
conn = <sqlalchemy.engine.base.Connection object at 0x267a910>
def _run_visitor(self, visitorcallable, element,
connection=None, **kwargs):
with self._optional_conn_ctx_manager(connection) as conn:
> conn._run_visitor(visitorcallable, element, **kwargs)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1479:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.engine.base.Connection object at 0x267a910>
visitorcallable = <class 'sqlalchemy.engine.ddl.SchemaGenerator'>
element = MetaData(bind=None)
kwargs = {'checkfirst': True, 'tables': [Table('court_building', MetaData(bind=None), Column('id', Integer(), table=<co...uildi...('id', Integer(), table=<charge>, p..., table=<charge>), Column('date_created', Date(), table=<charge>), schema=None)]}
def _run_visitor(self, visitorcallable, element, **kwargs):
visitorcallable(self.dialect, self,
> **kwargs).traverse_single(element)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1122:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>
obj = MetaData(bind=None), kw = {}
v = <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>
meth = <bound method SchemaGenerator.visit_metadata of <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>>
def traverse_single(self, obj, **kw):
for v in self._visitor_iterator:
meth = getattr(v, "visit_%s" % obj.__visit_name__, None)
if meth:
> return meth(obj, **kw)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py:122:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>
metadata = MetaData(bind=None)
def visit_metadata(self, metadata):
if self.tables is not None:
tables = self.tables
else:
tables = metadata.tables.values()
collection = [t for t in sql_util.sort_tables(tables)
if self._can_create_table(t)]
seq_coll = [s for s in metadata._sequences.values()
if s.column is None and self._can_create_sequence(s)]
metadata.dispatch.before_create(metadata, self.connection,
tables=collection,
checkfirst=self.checkfirst,
_ddl_runner=self)
for seq in seq_coll:
self.traverse_single(seq, create_ok=True)
for table in collection:
> self.traverse_single(table, create_ok=True)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>
obj = Table('person', MetaData(bind=None), Column('id', Integer(), table=<person>, p..., table=<person>), Column('date_created', Date(), table=<person>), schema=None)
kw = {'create_ok': True}
v = <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>
meth = <bound method SchemaGenerator.visit_table of <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>>
def traverse_single(self, obj, **kw):
for v in self._visitor_iterator:
meth = getattr(v, "visit_%s" % obj.__visit_name__, None)
if meth:
> return meth(obj, **kw)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py:122:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>
table = Table('person', MetaData(bind=None), Column('id', Integer(), table=<person>, p..., table=<person>), Column('date_created', Date(), table=<person>), schema=None)
create_ok = True
def visit_table(self, table, create_ok=False):
if not create_ok and not self._can_create_table(table):
return
table.dispatch.before_create(table, self.connection,
checkfirst=self.checkfirst,
> _ddl_runner=self)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.event._ListenerCollection object at 0x37295d0>
args = (Table('person', MetaData(bind=None), Column('id', Integer(), table=<person>, p..., table=<person>), Column('date_created', Date(), table=<person>), schema=None), <sqlalchemy.engine.base.Connection object at 0x267a910>)
kw = {'_ddl_runner': <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>, 'checkfirst': True}
fn = <sqlalchemy.util.langhelpers.portable_instancemethod object at 0x3729510>
def __call__(self, *args, **kw):
"""Execute this event."""
for fn in self.parent_listeners:
fn(*args, **kw)
for fn in self.listeners:
> fn(*args, **kw)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/event.py:409:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.util.langhelpers.portable_instancemethod object at 0x3729510>
arg = (Table('person', MetaData(bind=None), Column('id', Integer(), table=<person>, p..., table=<person>), Column('date_created', Date(), table=<person>), schema=None), <sqlalchemy.engine.base.Connection object at 0x267a910>)
kw = {'_ddl_runner': <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>, 'checkfirst': True}
def __call__(self, *arg, **kw):
> return getattr(self.target, self.name)(*arg, **kw)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Enum('M', 'F')
target = Table('person', MetaData(bind=None), Column('id', Integer(), table=<person>, p..., table=<person>), Column('date_created', Date(), table=<person>), schema=None)
bind = <sqlalchemy.engine.base.Connection object at 0x267a910>
kw = {'_ddl_runner': <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>, 'checkfirst': True}
t = _PGEnum()
def _on_table_create(self, target, bind, **kw):
t = self.dialect_impl(bind.dialect)
if t.__class__ is not self.__class__ and isinstance(t, SchemaType):
> t._on_table_create(target, bind, **kw)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/types.py:1933:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = _PGEnum()
target = Table('person', MetaData(bind=None), Column('id', Integer(), table=<person>, p..., table=<person>), Column('date_created', Date(), table=<person>), schema=None)
bind = <sqlalchemy.engine.base.Connection object at 0x267a910>
checkfirst = True
kw = {'_ddl_runner': <sqlalchemy.engine.ddl.SchemaGenerator object at 0x267a850>}
def _on_table_create(self, target, bind, checkfirst, **kw):
if not self._check_for_name_in_memos(checkfirst, kw):
> self.create(bind=bind, checkfirst=checkfirst)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py:870:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = _PGEnum(), bind = <sqlalchemy.engine.base.Connection object at 0x267a910>
checkfirst = True
def create(self, bind=None, checkfirst=True):
"""Emit ``CREATE TYPE`` for this
:class:`~.postgresql.ENUM`.
If the underlying dialect does not support
Postgresql CREATE TYPE, no action is taken.
:param bind: a connectable :class:`.Engine`,
:class:`.Connection`, or similar object to emit
SQL.
:param checkfirst: if ``True``, a query against
the PG catalog will be first performed to see
if the type does not exist already before
creating.
"""
if not bind.dialect.supports_native_enum:
return
if not checkfirst or \
not bind.dialect.has_type(bind, self.name, schema=self.schema):
> bind.execute(CreateEnumType(self))
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py:821:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.engine.base.Connection object at 0x267a910>
object = <sqlalchemy.dialects.postgresql.base.CreateEnumType object at 0x267e6d0>
multiparams = (), params = {}, c = <class 'sqlalchemy.schema.DDLElement'>
def execute(self, object, *multiparams, **params):
"""Executes the a SQL statement construct and returns a
:class:`.ResultProxy`.
:param object: The statement to be executed. May be
one of:
* a plain string
* any :class:`.ClauseElement` construct that is also
a subclass of :class:`.Executable`, such as a
:func:`~.expression.select` construct
* a :class:`.FunctionElement`, such as that generated
by :attr:`.func`, will be automatically wrapped in
a SELECT statement, which is then executed.
* a :class:`.DDLElement` object
* a :class:`.DefaultGenerator` object
* a :class:`.Compiled` object
:param \*multiparams/\**params: represent bound parameter
values to be used in the execution. Typically,
the format is either a collection of one or more
dictionaries passed to \*multiparams::
conn.execute(
table.insert(),
{"id":1, "value":"v1"},
{"id":2, "value":"v2"}
)
...or individual key/values interpreted by \**params::
conn.execute(
table.insert(), id=1, value="v1"
)
In the case that a plain SQL string is passed, and the underlying
DBAPI accepts positional bind parameters, a collection of tuples
or individual values in \*multiparams may be passed::
conn.execute(
"INSERT INTO table (id, value) VALUES (?, ?)",
(1, "v1"), (2, "v2")
)
conn.execute(
"INSERT INTO table (id, value) VALUES (?, ?)",
1, "v1"
)
Note above, the usage of a question mark "?" or other
symbol is contingent upon the "paramstyle" accepted by the DBAPI
in use, which may be any of "qmark", "named", "pyformat", "format",
"numeric". See `pep-249 <http://www.python.org/dev/peps/pep-0249/>`_
for details on paramstyle.
To execute a textual SQL statement which uses bound parameters in a
DBAPI-agnostic way, use the :func:`~.expression.text` construct.
"""
for c in type(object).__mro__:
if c in Connection.executors:
return Connection.executors[c](
self,
object,
multiparams,
> params)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:662:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.engine.base.Connection object at 0x267a910>
ddl = <sqlalchemy.dialects.postgresql.base.CreateEnumType object at 0x267e6d0>
multiparams = (), params = {}
def _execute_ddl(self, ddl, multiparams, params):
"""Execute a schema.DDL object."""
if self._has_events:
for fn in self.dispatch.before_execute:
ddl, multiparams, params = \
fn(self, ddl, multiparams, params)
dialect = self.dialect
> compiled = ddl.compile(dialect=dialect)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:714:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.dialects.postgresql.base.CreateEnumType object at 0x267e6d0>
bind = None
dialect = <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0x2658890>
kw = {}
def compile(self, bind=None, dialect=None, **kw):
"""Compile this SQL expression.
The return value is a :class:`~.Compiled` object.
Calling ``str()`` or ``unicode()`` on the returned value will yield a
string representation of the result. The
:class:`~.Compiled` object also can return a
dictionary of bind parameter names and values
using the ``params`` accessor.
:param bind: An ``Engine`` or ``Connection`` from which a
``Compiled`` will be acquired. This argument takes precedence over
this :class:`.ClauseElement`'s bound engine, if any.
:param column_keys: Used for INSERT and UPDATE statements, a list of
column names which should be present in the VALUES clause of the
compiled statement. If ``None``, all columns from the target table
object are rendered.
:param dialect: A ``Dialect`` instance from which a ``Compiled``
will be acquired. This argument takes precedence over the `bind`
argument as well as this :class:`.ClauseElement`'s bound engine, if
any.
:param inline: Used for INSERT statements, for a dialect which does
not support inline retrieval of newly generated primary key
columns, will force the expression used to create the new primary
key value to be rendered inline within the INSERT statement's
VALUES clause. This typically refers to Sequence execution but may
also refer to any server-side default generation function
associated with a primary key `Column`.
"""
if not dialect:
if bind:
dialect = bind.dialect
elif self.bind:
dialect = self.bind.dialect
bind = self.bind
else:
dialect = default.DefaultDialect()
> return self._compiler(dialect, bind=bind, **kw)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/sql/expression.py:1920:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.dialects.postgresql.base.CreateEnumType object at 0x267e6d0>
dialect = <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0x2658890>
kw = {'bind': None}
def _compiler(self, dialect, **kw):
"""Return a compiler appropriate for this ClauseElement, given a
Dialect."""
> return dialect.ddl_compiler(dialect, self, **kw)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/schema.py:2954:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.dialects.postgresql.base.PGDDLCompiler object at 0x267e890>
dialect = <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0x2658890>
statement = <sqlalchemy.dialects.postgresql.base.CreateEnumType object at 0x267e6d0>
bind = None, compile_kwargs = immutabledict({})
def __init__(self, dialect, statement, bind=None,
compile_kwargs=util.immutabledict()):
"""Construct a new ``Compiled`` object.
:param dialect: ``Dialect`` to compile against.
:param statement: ``ClauseElement`` to be compiled.
:param bind: Optional Engine or Connection to compile this
statement against.
:param compile_kwargs: additional kwargs that will be
passed to the initial call to :meth:`.Compiled.process`.
.. versionadded:: 0.8
"""
self.dialect = dialect
self.bind = bind
if statement is not None:
self.statement = statement
self.can_execute = statement.supports_execution
> self.string = self.process(self.statement, **compile_kwargs)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/engine/interfaces.py:787:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.dialects.postgresql.base.PGDDLCompiler object at 0x267e890>
obj = <sqlalchemy.dialects.postgresql.base.CreateEnumType object at 0x267e6d0>
kwargs = {}
def process(self, obj, **kwargs):
> return obj._compiler_dispatch(self, **kwargs)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/engine/interfaces.py:806:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.dialects.postgresql.base.CreateEnumType object at 0x267e6d0>
visitor = <sqlalchemy.dialects.postgresql.base.PGDDLCompiler object at 0x267e890>
kw = {}
meth = <bound method PGDDLCompiler.visit_create_enum_type of <sqlalchemy.dialects.postgresql.base.PGDDLCompiler object at 0x267e890>>
def _compiler_dispatch(self, visitor, **kw):
try:
meth = getter(visitor)
except AttributeError:
raise exc.UnsupportedCompilationError(visitor, cls)
else:
> return meth(self, **kw)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.dialects.postgresql.base.PGDDLCompiler object at 0x267e890>
create = <sqlalchemy.dialects.postgresql.base.CreateEnumType object at 0x267e6d0>
def visit_create_enum_type(self, create):
type_ = create.element
return "CREATE TYPE %s AS ENUM (%s)" % (
> self.preparer.format_type(type_),
",".join("'%s'" % e for e in type_.enums)
)
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py:1072:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy.dialects.postgresql.psycopg2.PGIdentifierPreparer_psycopg2 object at 0x265d810>
type_ = _PGEnum(), use_schema = True
def format_type(self, type_, use_schema=True):
if not type_.name:
> raise exc.CompileError("Postgresql ENUM type requires a name.")
E CompileError: Postgresql ENUM type requires a name.
../../.virtualenvs/ccj-dev/local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py:1254: CompileError
===================== 1 failed, 15 passed in 0.87 seconds ======================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment