From f39767ad727fcc9493d41451d7112d4f3459e9c4 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 13 Aug 2014 17:42:33 -0400 Subject: - public method name is get_enums() - return a list of dicts like other methods do - don't combine 'schema' with 'name', leave them separate - support '*' argument so that we can retrieve cross-schema if needed - remove "conn" argument - use bound parameters for 'schema' in SQL - order by schema, name, label - adapt _load_enums changes to column reflection - changelog - module docs for get_enums() - add drop of enums to --dropfirst --- lib/sqlalchemy/testing/plugin/plugin_base.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/testing/plugin/plugin_base.py') diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index 4c245e9e9..9c63a2e1d 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -315,7 +315,7 @@ def _setup_requirements(argument): @post def _prep_testing_database(options, file_config): from sqlalchemy.testing import config - from sqlalchemy import schema, inspect + from sqlalchemy import schema, inspect, testing if options.dropfirst: for cfg in config.Config.all_configs(): @@ -358,6 +358,14 @@ def _prep_testing_database(options, file_config): schema="test_schema") )) + if testing.against("postgresql"): + from sqlalchemy.dialects import postgresql + for enum in inspector.get_enums("*"): + e.execute(postgresql.DropEnumType( + postgresql.ENUM( + name=enum['name'], + schema=enum['schema']))) + @post def _set_table_options(options, file_config): -- cgit v1.2.1