Skip to content

Commit 17fb170

Browse files
committed
enforce some checks (flake8)
1 parent 0e3a50e commit 17fb170

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
description-file = README.md
33

44
[flake8]
5-
ignore = E501, F401, F403, F841
6-
exclude = .git,__pycache__,env,venv
5+
ignore = E501
6+
exclude = .git,__pycache__,env,venv,testgres/__init__.py

testgres/node.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
from .utils import \
3838
get_bin_path, \
39-
get_pg_version, \
4039
pg_version_ge as _pg_version_ge, \
4140
reserve_port as _reserve_port, \
4241
release_port as _release_port, \
@@ -159,7 +158,7 @@ def print_node_file(node_file):
159158
try:
160159
with io.open(node_file, "r") as f:
161160
return f.read().decode('utf-8')
162-
except Exception as e:
161+
except Exception:
163162
pass
164163
return "### file not found ###\n"
165164

@@ -389,7 +388,7 @@ def start(self, params=[]):
389388

390389
try:
391390
_execute_utility(_params, self.utils_log_name)
392-
except ExecUtilException as e:
391+
except ExecUtilException:
393392
msg = (
394393
u"Cannot start node\n"
395394
u"{}\n" # pg_ctl log
@@ -447,7 +446,7 @@ def restart(self, params=[]):
447446

448447
try:
449448
_execute_utility(_params, self.utils_log_name)
450-
except ExecUtilException as e:
449+
except ExecUtilException:
451450
msg = (
452451
u"Cannot restart node\n"
453452
u"{}\n" # pg_ctl log
@@ -525,9 +524,9 @@ def cleanup(self, max_attempts=3):
525524
try:
526525
self.stop()
527526
break # OK
528-
except ExecUtilException as e:
527+
except ExecUtilException:
529528
pass # one more time
530-
except Exception as e:
529+
except Exception:
531530
break # screw this
532531

533532
attempts += 1

tests/test_simple.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,12 @@ def test_backup_exhaust(self):
294294
with node.backup(xlog_method='fetch') as backup:
295295

296296
# exhaust backup by creating new node
297-
with backup.spawn_primary('node1') as node1:
297+
with backup.spawn_primary('node1') as node1: # noqa
298298
pass
299299

300300
# now let's try to create one more node
301301
with self.assertRaises(BackupException):
302-
with backup.spawn_primary('node2') as node2:
302+
with backup.spawn_primary('node2') as node2: # noqa
303303
pass
304304

305305
def test_backup_and_replication(self):
@@ -567,7 +567,6 @@ def test_version_management(self):
567567

568568
def test_config(self):
569569
# set global if it wasn't set
570-
pg_config = get_pg_config()
571570
configure_testgres(cache_initdb=True, cache_pg_config=True)
572571

573572
# check same instances

0 commit comments

Comments
 (0)