Skip to content

Commit 2fb42ec

Browse files
author
v.shepard
committed
Merge master
2 parents 86ef2fb + ceb1ee9 commit 2fb42ec

17 files changed

+165
-141
lines changed

.travis.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
sudo: required
1+
os: linux
2+
3+
dist: bionic
24

35
language: python
46

@@ -18,14 +20,15 @@ notifications:
1820
on_failure: always
1921

2022
env:
21-
- PYTHON_VERSION=2 PG_VERSION=10
22-
- PYTHON_VERSION=2 PG_VERSION=9.6
23-
- PYTHON_VERSION=2 PG_VERSION=9.5
24-
- PYTHON_VERSION=2 PG_VERSION=9.4
23+
- PYTHON_VERSION=3 PG_VERSION=14
2524
- PYTHON_VERSION=3 PG_VERSION=13
2625
- PYTHON_VERSION=3 PG_VERSION=12
2726
- PYTHON_VERSION=3 PG_VERSION=11
2827
- PYTHON_VERSION=3 PG_VERSION=10
29-
- PYTHON_VERSION=3 PG_VERSION=9.6
30-
- PYTHON_VERSION=3 PG_VERSION=9.5
31-
- PYTHON_VERSION=3 PG_VERSION=9.4
28+
# - PYTHON_VERSION=3 PG_VERSION=9.6
29+
# - PYTHON_VERSION=3 PG_VERSION=9.5
30+
# - PYTHON_VERSION=3 PG_VERSION=9.4
31+
# - PYTHON_VERSION=2 PG_VERSION=10
32+
# - PYTHON_VERSION=2 PG_VERSION=9.6
33+
# - PYTHON_VERSION=2 PG_VERSION=9.5
34+
# - PYTHON_VERSION=2 PG_VERSION=9.4

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/postgrespro/testgres.svg?branch=master)](https://travis-ci.org/postgrespro/testgres)
1+
[![Build Status](https://travis-ci.com/postgrespro/testgres.svg?branch=master)](https://app.travis-ci.com/github/postgrespro/testgres/branches)
22
[![codecov](https://codecov.io/gh/postgrespro/testgres/branch/master/graph/badge.svg)](https://codecov.io/gh/postgrespro/testgres)
33
[![PyPI version](https://badge.fury.io/py/testgres.svg)](https://badge.fury.io/py/testgres)
44

docs/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Building the documentation
22

3-
Make sure you have `Sphinx` and `sphinxcontrib-napoleon` packages installed:
3+
Make sure you have `Sphinx` package installed:
44

55
```
6-
pip install Sphinx sphinxcontrib-napoleon
6+
pip install Sphinx
77
```
88

99
Then just run
@@ -12,4 +12,4 @@ Then just run
1212
make html
1313
```
1414

15-
Documentation will be built in `build/html` directory. Other output formats are also available; run `make` without arguments to see the options.
15+
Documentation will be built in `build/html` directory. Other output formats are also available; run `make` without arguments to see the options.

docs/source/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# -- Project information -----------------------------------------------------
2020

2121
project = u'testgres'
22-
copyright = u'2016-2018, Postgres Professional'
22+
copyright = u'2016-2022, Postgres Professional'
2323
author = u'Postgres Professional'
2424

2525
# The short X.Y version
@@ -36,7 +36,7 @@
3636
# Add any Sphinx extension module names here, as strings. They can be
3737
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3838
# ones.
39-
extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.napoleon']
39+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
4040

4141
# Add any paths that contain templates here, relative to this directory.
4242
templates_path = ['_templates']

run_tests.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Copyright (c) 2017, Postgres Professional
3+
# Copyright (c) 2017-2022 Postgres Professional
44

55
set -eux
66

@@ -22,7 +22,7 @@ export VIRTUAL_ENV_DISABLE_PROMPT=1
2222
source $VENV_PATH/bin/activate
2323

2424
# install utilities
25-
$PIP install coverage flake8 psutil Sphinx sphinxcontrib-napoleon
25+
$PIP install coverage flake8 psutil Sphinx
2626

2727
# install testgres' dependencies
2828
export PYTHONPATH=$(pwd)

testgres/__init__.py

+29-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,23 @@
1515
ProgrammingError, \
1616
OperationalError
1717

18-
from .exceptions import *
19-
from .enums import *
18+
from .exceptions import \
19+
TestgresException, \
20+
ExecUtilException, \
21+
QueryException, \
22+
TimeoutException, \
23+
CatchUpException, \
24+
StartNodeException, \
25+
InitNodeException, \
26+
BackupException
27+
28+
from .enums import \
29+
XLogMethod, \
30+
IsolationLevel, \
31+
NodeStatus, \
32+
ProcessType, \
33+
DumpFormat
34+
2035
from .node import PostgresNode
2136

2237
from .utils import \
@@ -30,3 +45,15 @@
3045
from .standby import \
3146
First, \
3247
Any
48+
49+
__all__ = [
50+
"get_new_node",
51+
"NodeBackup",
52+
"TestgresConfig", "configure_testgres", "scoped_config", "push_config", "pop_config",
53+
"NodeConnection", "DatabaseError", "InternalError", "ProgrammingError", "OperationalError",
54+
"TestgresException", "ExecUtilException", "QueryException", "TimeoutException", "CatchUpException", "StartNodeException", "InitNodeException", "BackupException",
55+
"XLogMethod", "IsolationLevel", "NodeStatus", "ProcessType", "DumpFormat",
56+
"PostgresNode",
57+
"reserve_port", "release_port", "bound_ports", "get_bin_path", "get_pg_config", "get_pg_version",
58+
"First", "Any",
59+
]

testgres/backup.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class NodeBackup(object):
2929
"""
3030
Smart object responsible for backups
3131
"""
32-
3332
@property
3433
def log_file(self):
3534
return os.path.join(self.base_dir, BACKUP_LOG_FILE)

testgres/cache.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@
2424
def cached_initdb(data_dir, logfile=None, hostname='localhost', ssh_key=None, params=None):
2525
"""
2626
Perform initdb or use cached node files.
27-
28-
DDD return
2927
"""
30-
28+
3129
def call_initdb(initdb_dir, log=None):
3230
try:
3331
_params = [get_bin_path("initdb"), "-D", initdb_dir, "-N"]

testgres/config.py

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class GlobalConfig(object):
4343

4444
_cached_initdb_dir = None
4545
""" underlying class attribute for cached_initdb_dir property """
46-
4746
@property
4847
def cached_initdb_dir(self):
4948
""" path to a temp directory for cached initdb. """

testgres/connection.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class NodeConnection(object):
2828
"""
2929
Transaction wrapper returned by Node
3030
"""
31-
3231
def __init__(self,
3332
node,
3433
dbname=None,
@@ -42,12 +41,11 @@ def __init__(self,
4241

4342
self._node = node
4443

45-
self._connection = pglib.connect(
46-
database=dbname,
47-
user=username,
48-
password=password,
49-
host=node.host,
50-
port=node.port)
44+
self._connection = pglib.connect(database=dbname,
45+
user=username,
46+
password=password,
47+
host=node.host,
48+
port=node.port)
5149

5250
self._connection.autocommit = autocommit
5351
self._cursor = self.connection.cursor()

testgres/decorators.py

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def method_decorator(decorator):
5050
"""
5151
Convert a function decorator into a method decorator.
5252
"""
53-
5453
def _dec(func):
5554
def _wrapper(self, *args, **kwargs):
5655
@decorator

testgres/logger.py

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class TestgresLogger(threading.Thread):
2424
"""
2525
Helper class to implement reading from log files.
2626
"""
27-
2827
def __init__(self, node_name, log_file_name):
2928
threading.Thread.__init__(self)
3029

0 commit comments

Comments
 (0)