From 577445d8ff5e0ea89ccaf09fd5b82165a0875afe Mon Sep 17 00:00:00 2001 From: Julio Lajara Date: Thu, 1 Sep 2016 01:04:38 -0400 Subject: [PATCH 1/7] Add CentOS/RHEL postgesql home directory blob to search patterns. --- src/testing/postgresql.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/testing/postgresql.py b/src/testing/postgresql.py index 948fc3c..d4ea0d2 100644 --- a/src/testing/postgresql.py +++ b/src/testing/postgresql.py @@ -28,6 +28,7 @@ __all__ = ['Postgresql', 'skipIfNotFound'] SEARCH_PATHS = (['/usr/local/pgsql', '/usr/local'] + + glob('/usr/pgsql-*') + # for CentOS/RHEL glob('/usr/lib/postgresql/*') + # for Debian/Ubuntu glob('/opt/local/lib/postgresql*')) # for MacPorts From bf8b7c0a3b40acceacc60ef373fd2005a48e9f50 Mon Sep 17 00:00:00 2001 From: Anthony Delosa Date: Mon, 24 Oct 2016 21:53:38 +1000 Subject: [PATCH 2/7] Fix to support Windows (tk0miya/testing.postgresql#16) * Assumes all other platforms work with sigint instead of sigterm * testcases are broken on Windows due to use of os.fork --- src/testing/postgresql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testing/postgresql.py b/src/testing/postgresql.py index 948fc3c..052860a 100644 --- a/src/testing/postgresql.py +++ b/src/testing/postgresql.py @@ -113,7 +113,7 @@ def is_server_available(self): def terminate(self, *args): # send SIGINT instead of SIGTERM - super(Postgresql, self).terminate(signal.SIGINT) + super(Postgresql, self).terminate(signal.SIGINT if os.name != 'nt' else None) class PostgresqlFactory(DatabaseFactory): From 5d1eac3e11313b38b842f0bc8d418797c0e25a67 Mon Sep 17 00:00:00 2001 From: Anthony Delosa Date: Mon, 24 Oct 2016 22:15:55 +1000 Subject: [PATCH 3/7] Merged in skip of tests containing os.fork for Window from windows _support branch. --- tests/test_postgresql.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_postgresql.py b/tests/test_postgresql.py index b3603a2..9d25e84 100644 --- a/tests/test_postgresql.py +++ b/tests/test_postgresql.py @@ -116,6 +116,7 @@ def test_postgresql_is_not_found(self): testing.postgresql.SEARCH_PATHS = search_paths os.environ['PATH'] = path_env + @unittest.skipIf(os.name == 'nt', 'Windows does not have fork()') def test_fork(self): pgsql = testing.postgresql.Postgresql() if os.fork() == 0: @@ -127,6 +128,7 @@ def test_fork(self): sleep(1) self.assertTrue(pgsql.is_alive()) # process is alive (delete pgsql obj in child does not effect) + @unittest.skipIf(os.name == 'nt', 'Windows does not have fork()') def test_stop_on_child_process(self): pgsql = testing.postgresql.Postgresql() if os.fork() == 0: From 4d3ef9c6c948b0ef7acee3ec5073057c504d0223 Mon Sep 17 00:00:00 2001 From: Anthony Delosa Date: Mon, 24 Oct 2016 23:01:51 +1000 Subject: [PATCH 4/7] Updates py26 to use 2.6.0 version of flake8. Py26 +Windows is broken. --- tox.ini | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index c2d340c..bbd80fd 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,16 @@ [tox] envlist=py26,py27,py32,py33,py34,py35 -[testenv] +[base] deps= nose - flake8 psycopg2 SQLAlchemy + +[testenv] +deps= + {[base]deps} + flake8 passenv= TRAVIS* commands= @@ -15,8 +19,9 @@ commands= [testenv:py26] deps= - {[testenv]deps} + {[base]deps} unittest2 + flake8==2.6.0 [testenv:coverage] deps= From c79c8549f3da4eb64834aaa6cba009a6f14d7aea Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Fri, 13 Jan 2017 01:12:13 +0900 Subject: [PATCH 5/7] Drop py2.6, 3.2 and 3.3 support. Add py3.6 support --- README.rst | 2 +- tests/test_postgresql.py | 7 +------ tox.ini | 7 +------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index b3cfc22..ff280e9 100644 --- a/README.rst +++ b/README.rst @@ -123,7 +123,7 @@ If you want to insert fixtures to the cached database, use ``initdb_handler`` op Requirements ============ -* Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5 +* Python 2.7, 3.4, 3.5, 3.6 * pg8000 1.10 License diff --git a/tests/test_postgresql.py b/tests/test_postgresql.py index b3603a2..be16511 100644 --- a/tests/test_postgresql.py +++ b/tests/test_postgresql.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- import os -import sys import signal import tempfile +import unittest import testing.postgresql from time import sleep from shutil import rmtree @@ -12,11 +12,6 @@ import sqlalchemy from contextlib import closing -if sys.version_info < (2, 7): - import unittest2 as unittest -else: - import unittest - class TestPostgresql(unittest.TestCase): def test_basic(self): diff --git a/tox.ini b/tox.ini index c2d340c..41a7468 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py26,py27,py32,py33,py34,py35 +envlist=py27,py34,py35,py36 [testenv] deps= @@ -13,11 +13,6 @@ commands= nosetests flake8 --exclude=.tox/ -[testenv:py26] -deps= - {[testenv]deps} - unittest2 - [testenv:coverage] deps= {[testenv]deps} From 294ce5c760e896827c65bfea2e4f967522ceab2c Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Fri, 13 Jan 2017 01:19:16 +0900 Subject: [PATCH 6/7] Fix typo --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index e8bc7b2..41a7468 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist=py27,py34,py35,py36 -[base] +[testenv] deps= nose flake8 From 9951ad7e8e555b530d2fd8a1a5c89af6d855db5c Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Fri, 13 Jan 2017 01:48:45 +0900 Subject: [PATCH 7/7] Update travis.yml --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 37fd50f..d64a97b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,7 @@ language: python python: 3.5 env: matrix: - - TOXENV=py26 - TOXENV=py27 - - TOXENV=py33 - TOXENV=py34 - TOXENV=py35 - TOXENV=coverage