10000 Test refactoring by dmitry-lipetsk · Pull Request #236 · postgrespro/testgres · GitHub
[go: up one dir, main page]

Skip to content

Test refactoring #236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TestTestgresCommon::test_node_repr is added
  • Loading branch information
dmitry-lipetsk committed Apr 6, 2025
commit 2ef2e006f8401b3c226292b44ade65e5d8dc8ca5
5 changes: 5 additions & 0 deletions tests/test_testgres_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ def test_version_management(self, node_svc: PostgresNodeService):
assert (isinstance(node.version, PgVer))
assert (node.version == PgVer(version))

def test_node_repr(self, node_svc: PostgresNodeService):
with __class__.helper__get_node(node_svc).init() as node:
pattern = r"PostgresNode\(name='.+', port=.+, base_dir='.+'\)"
assert re.match(pattern, str(node)) is not None

def test_double_init(self, node_svc: PostgresNodeService):
assert isinstance(node_svc, PostgresNodeService)

Expand Down
5 changes: 0 additions & 5 deletions tests/test_testgres_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ def rm_carriage_returns(out):


class TestTestgresLocal:
def test_node_repr(self):
with get_new_node() as node:
pattern = r"PostgresNode\(name='.+', port=.+, base_dir='.+'\)"
assert re.match(pattern, str(node)) is not None

def test_custom_init(self):
with get_new_node() as node:
# enable page checksums
Expand Down
6 changes: 0 additions & 6 deletions tests/test_testgres_remote.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# coding: utf-8
import os
import re

import pytest
import logging
Expand Down Expand Up @@ -58,11 +57,6 @@ def implicit_fixture(self):
testgres_config.set_os_ops(os_ops=prev_ops)
assert testgres_config.os_ops is prev_ops

def test_node_repr(self):
with __class__.helper__get_node() as node:
pattern = r"PostgresNode\(name='.+', port=.+, base_dir='.+'\)"
assert re.match(pattern, str(node)) is not None

def test_custom_init(self):
with __class__.helper__get_node() as node:
# enable page checksums
Expand Down
0