From d303057971c95f723ea73b61362d9a4e2ce2c09d Mon Sep 17 00:00:00 2001 From: stalkerg Date: Tue, 20 Dec 2016 16:36:23 +0300 Subject: [PATCH 1/4] Add params for init. --- testgres/testgres.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testgres/testgres.py b/testgres/testgres.py index af784b91..f1d34460 100644 --- a/testgres/testgres.py +++ b/testgres/testgres.py @@ -179,7 +179,7 @@ def get_bin_path(self, filename): else: return os.path.join(pg_config.get("BINDIR"), filename) - def init(self, allows_streaming=False): + def init(self, allows_streaming=False, initdb_params=[]): """ Performs initdb """ postgres_conf = os.path.join(self.data_dir, "postgresql.conf") @@ -195,7 +195,7 @@ def init(self, allows_streaming=False): initdb = self.get_bin_path("initdb") with open(os.path.join(self.logs_dir, "initdb.log"), "a") as file_out: ret = subprocess.call( - [initdb, self.data_dir, "-N"], + [initdb, self.data_dir, "-N"] + initdb_params, stdout=file_out, stderr=subprocess.STDOUT ) From cc19f497b1595bea247f3b122c78217cdc42ebf1 Mon Sep 17 00:00:00 2001 From: stalkerg Date: Tue, 20 Dec 2016 16:38:52 +0300 Subject: [PATCH 2/4] Import all functions and classes important for exceptions. --- testgres/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testgres/__init__.py b/testgres/__init__.py index 25f044b8..414e2ac5 100644 --- a/testgres/__init__.py +++ b/testgres/__init__.py @@ -1 +1 @@ -from .testgres import PostgresNode, get_new_node, clean_all, stop_all +from .testgres import * From 25c9b4151cd6d7493b38022035e6b78925504877 Mon Sep 17 00:00:00 2001 From: stalkerg Date: Tue, 20 Dec 2016 16:47:12 +0300 Subject: [PATCH 3/4] Test --- testgres/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testgres/__init__.py b/testgres/__init__.py index 414e2ac5..c3961685 100644 --- a/testgres/__init__.py +++ b/testgres/__init__.py @@ -1 +1 @@ -from .testgres import * +from __future__ import absolute_import From 7e0e8dd46ee73d4a124e8b0c1f1274bfd33b143a Mon Sep 17 00:00:00 2001 From: stalkerg Date: Tue, 20 Dec 2016 16:57:23 +0300 Subject: [PATCH 4/4] Make right import all subelements. --- .travis.yml | 2 +- testgres/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b649816..7d5f8d54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ install: - pip install flake8 script: - - flake8 --ignore=W191,F401,E501 . + - flake8 --ignore=W191,F401,E501,F403 . notifications: email: diff --git a/testgres/__init__.py b/testgres/__init__.py index c3961685..414e2ac5 100644 --- a/testgres/__init__.py +++ b/testgres/__init__.py @@ -1 +1 @@ -from __future__ import absolute_import +from .testgres import *