diff --git a/src/testing/postgresql.py b/src/testing/postgresql.py index d4ea0d2..592f707 100644 --- a/src/testing/postgresql.py +++ b/src/testing/postgresql.py @@ -114,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 be16511..1fa1116 100644 --- a/tests/test_postgresql.py +++ b/tests/test_postgresql.py @@ -111,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: @@ -122,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 41a7468..e8bc7b2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist=py27,py34,py35,py36 -[testenv] +[base] deps= nose flake8