Make pyscopg2 version parsing more robust (#1052)

non-released version can have unparsable suffixes, for example 2.8.3.dev0
This commit is contained in:
Alexander Kukushkin
2019-05-13 14:18:56 +02:00
committed by GitHub
parent bba9066315
commit c7db134a20
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -159,5 +159,5 @@ class TestPatroni(unittest.TestCase):
def test_check_psycopg2(self):
with patch.object(builtins, '__import__', Mock(side_effect=ImportError)):
self.assertRaises(SystemExit, check_psycopg2)
with patch.object(psycopg2, '__version__', return_value='2.5.3 a b c'):
with patch.object(psycopg2, '__version__', return_value='2.5.3.dev1 a b c'):
self.assertRaises(SystemExit, check_psycopg2)