mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-04-28 20:23:42 +03:00
Skip copy tests on CockroachDB
This commit is contained in:
parent
e154cbe5aa
commit
7e1e801899
|
@ -27,7 +27,8 @@ import io
|
||||||
import sys
|
import sys
|
||||||
import string
|
import string
|
||||||
import unittest
|
import unittest
|
||||||
from .testutils import (ConnectingTestCase, skip_before_postgres, slow, StringIO)
|
from .testutils import ConnectingTestCase, skip_before_postgres, slow, StringIO
|
||||||
|
from .testutils import crdb_version, skip_if_crdb
|
||||||
from itertools import cycle
|
from itertools import cycle
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
|
@ -58,6 +59,7 @@ class MinimalWrite(TextIOBase):
|
||||||
return self.f.write(data)
|
return self.f.write(data)
|
||||||
|
|
||||||
|
|
||||||
|
@skip_if_crdb
|
||||||
@skip_copy_if_green
|
@skip_copy_if_green
|
||||||
class CopyTests(ConnectingTestCase):
|
class CopyTests(ConnectingTestCase):
|
||||||
|
|
||||||
|
@ -67,6 +69,8 @@ class CopyTests(ConnectingTestCase):
|
||||||
|
|
||||||
def _create_temp_table(self):
|
def _create_temp_table(self):
|
||||||
curs = self.conn.cursor()
|
curs = self.conn.cursor()
|
||||||
|
if crdb_version(self.conn) is not None:
|
||||||
|
curs.execute("SET experimental_enable_temp_tables = 'on'")
|
||||||
curs.execute('''
|
curs.execute('''
|
||||||
CREATE TEMPORARY TABLE tcopy (
|
CREATE TEMPORARY TABLE tcopy (
|
||||||
id serial PRIMARY KEY,
|
id serial PRIMARY KEY,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user