Compatibility with python 3.12 (#3058)

- monkey patch `jsonlogger.RESERVED_ATTRS` to hide new attribute in `LogRecord`
- "silence" warning about `atetime.datetime.utcnow()`
- run some tests with python 3.12
- bump actions versions to silence complains about Node version
- fix PATH to Postgres binaries on MacOS
This commit is contained in:
Alexander Kukushkin
2024-05-07 09:29:28 +02:00
committed by GitHub
parent 634b44ee05
commit 03bb9125cb
6 changed files with 47 additions and 31 deletions
+1 -1
View File
@@ -790,7 +790,7 @@ class TestHa(PostgresInit):
self.assertIn('Incorrect value of scheduled_at: %s', mock_warning.call_args_list[0][0])
# scheduled now
scheduled = datetime.datetime.utcnow().replace(tzinfo=tzutc)
scheduled = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=tzutc)
self.ha.cluster = get_cluster_initialized_with_leader(Failover(0, self.p.name, 'b', scheduled))
self.ha.cluster.members.append(Member(0, 'b', 28, {'api_url': 'http://127.0.0.1:8011/patroni'}))
self.assertEqual('switchover: demoting myself', self.ha.run_cycle())