Compatibility with prettytable>=3.12.0 (#3217)

They started showing deprecation warning when importing ALL and FRAME constants.
This commit is contained in:
Alexander Kukushkin
2024-11-19 09:09:09 +01:00
committed by GitHub
parent 3f00b7a6c7
commit 19f75b407e
3 changed files with 24 additions and 6 deletions
+9 -2
View File
@@ -9,7 +9,14 @@ import click
import etcd
from click.testing import CliRunner
from prettytable import ALL, PrettyTable
from prettytable import PrettyTable
try:
from prettytable import HRuleStyle
hrule_all = HRuleStyle.ALL
except ImportError:
from prettytable import ALL as hrule_all
from urllib3 import PoolManager
from patroni import global_config
@@ -747,7 +754,7 @@ class TestCtl(unittest.TestCase):
class TestPatronictlPrettyTable(unittest.TestCase):
def setUp(self):
self.pt = PatronictlPrettyTable(' header', ['foo', 'bar'], hrules=ALL)
self.pt = PatronictlPrettyTable(' header', ['foo', 'bar'], hrules=hrule_all)
def test__get_hline(self):
expected = '+-----+-----+'