diff options
| -rw-r--r-- | lib/sqlalchemy/testing/requirements.py | 8 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_dialect.py | 2 | ||||
| -rw-r--r-- | test/requirements.py | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 32465c47d..e8b3a995f 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -342,6 +342,14 @@ class SuiteRequirements(Requirements): return exclusions.open() @property + def duplicate_key_raises_integrity_error(self): + """target dialect raises IntegrityError when reporting an INSERT + with a primary key violation. (hint: it should) + + """ + return exclusions.open() + + @property def unbounded_varchar(self): """Target database must support VARCHAR with no length""" diff --git a/lib/sqlalchemy/testing/suite/test_dialect.py b/lib/sqlalchemy/testing/suite/test_dialect.py index 5ad5694b3..00884a212 100644 --- a/lib/sqlalchemy/testing/suite/test_dialect.py +++ b/lib/sqlalchemy/testing/suite/test_dialect.py @@ -1,4 +1,5 @@ from .. import fixtures, config +from ..config import requirements from sqlalchemy import exc from sqlalchemy import Integer, String from .. import assert_raises @@ -23,6 +24,7 @@ class ExceptionTest(fixtures.TablesTest): Column('data', String(50)) ) + @requirements.duplicate_key_raises_integrity_error def test_integrity_error(self): with config.db.begin() as conn: diff --git a/test/requirements.py b/test/requirements.py index 77d941a67..e993be2e7 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -669,6 +669,10 @@ class DefaultRequirements(SuiteRequirements): ) @property + def duplicate_key_raises_integrity_error(self): + return fails_on("postgresql+pg8000") + + @property def python2(self): return skip_if( lambda: sys.version_info >= (3,), |
