Permalink
Browse files

Changes resulting from or needed for testing against PostgresSQL 9.2rc1.

 * pyrseas/dbobject/operator.py (OperatorDict.query): Remove
   unnecessary casts to regproc.
 * tests/dbobject/test_operator.py (OperatorToMapTestCase): Change to
   reflect 9.2 output of querying pg_operator.
 * tests/dbobject/test_tablespace.py: Add comment explaining
   requirement for test tablespaces.
 * tox.ini: Add pg92 test environments.
  • Loading branch information...
1 parent 5c85749 commit 4d29698fa97db767d949f82bfcf62d1879f39c75 @jmafc jmafc committed Aug 31, 2012
Showing with 23 additions and 4 deletions.
  1. +3 −3 pyrseas/dbobject/operator.py
  2. +4 −1 tests/dbobject/test_operator.py
  3. +2 −0 tests/dbobject/test_tablespace.py
  4. +14 −0 tox.ini
@@ -78,9 +78,9 @@ class OperatorDict(DbObjectDict):
query = \
"""SELECT nspname AS schema, oprname AS name, rolname AS owner,
oprleft::regtype AS leftarg, oprright::regtype AS rightarg,
- oprcode::regproc AS procedure, oprcom::regoper AS commutator,
- oprnegate::regoper AS negator, oprrest::regproc AS restrict,
- oprjoin::regproc AS join, oprcanhash AS hashes,
+ oprcode AS procedure, oprcom::regoper AS commutator,
+ oprnegate::regoper AS negator, oprrest AS restrict,
+ oprjoin AS join, oprcanhash AS hashes,
oprcanmerge AS merges,
obj_description(o.oid, 'pg_operator') AS description
FROM pg_operator o
@@ -26,7 +26,10 @@ def test_map_operator_rightarg(self):
"Map a unitary operator with a right argument"
stmts = ["CREATE OPERATOR + (PROCEDURE = upper, RIGHTARG = text)"]
dbmap = self.to_map(stmts)
- expmap = {'procedure': 'upper'}
+ if self.db.version < 90200:
+ expmap = {'procedure': 'upper'}
+ else:
+ expmap = {'procedure': 'pg_catalog.upper'}
self.assertEqual(dbmap['schema public']['operator +(NONE, text)'],
expmap)
@@ -2,6 +2,8 @@
"""Test tablespaces
These tests require the existence of tablespaces ts1 and ts2.
+They should be owned by the user running the tests or the user should
+have been granted CREATE (or ALL) privileges on the tablespaces.
"""
import unittest
View
14 tox.ini
@@ -1,3 +1,7 @@
+[pg92]
+setenv =
+ PYRSEAS_TEST_PORT={env:PG92_PORT}
+
[pg91]
setenv =
PYRSEAS_TEST_PORT={env:PG91_PORT}
@@ -10,6 +14,11 @@ setenv =
setenv =
PYRSEAS_TEST_PORT={env:PG84_PORT}
+[testenv:py27pg92]
+basepython=python2.7
+envdir={toxworkdir}/py27
+setenv = {[pg92]setenv}
+
[testenv:py27pg91]
basepython=python2.7
envdir={toxworkdir}/py27
@@ -25,6 +34,11 @@ basepython=python2.7
envdir={toxworkdir}/py27
setenv = {[pg84]setenv}
+[testenv:py32pg92]
+basepython=python3.2
+envdir={toxworkdir}/py32
+setenv = {[pg92]setenv}
+
[testenv:py32pg91]
basepython=python3.2
envdir={toxworkdir}/py32

0 comments on commit 4d29698

Please sign in to comment.