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 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/src/testing/postgresql.py b/src/testing/postgresql.py index 948fc3c..592f707 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 @@ -113,7 +114,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): diff --git a/tests/test_postgresql.py b/tests/test_postgresql.py index b3603a2..1fa1116 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): @@ -116,6 +111,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 +123,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: 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}