8000 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
Next Next commit
TestUtils is added
  • Loading branch information
dmitry-lipetsk committed Apr 6, 2025
commit cd0635e917cf17ea0b10f9be241ad1529028c380
12 changes: 1 addition & 11 deletions tests/test_testgres_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# NOTE: those are ugly imports
from ..testgres import bound_ports
from ..testgres.utils import PgVer, parse_pg_version
from ..testgres.utils import PgVer
from ..testgres.node import ProcessProxy


Expand Down Expand Up @@ -234,16 +234,6 @@ def test_upgrade_node(self):
node_new.start()
assert (b'Upgrade Complete' in res)

def test_parse_pg_version(self):
# Linux Mint
assert parse_pg_version("postgres (PostgreSQL) 15.5 (Ubuntu 15.5-1.pgdg22.04+1)") == "15.5"
# Linux Ubuntu
assert parse_pg_version("postgres (PostgreSQL) 12.17") == "12.17"
# Windows
assert parse_pg_version("postgres (PostgreSQL) 11.4") == "11.4"
# Macos
assert parse_pg_version("postgres (PostgreSQL) 14.9 (Homebrew)") == "14.9"

class tagPortManagerProxy:
sm_prev_testgres_reserve_port = None
sm_prev_testgres_release_port = None
Expand Down
13 changes: 13 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from ..testgres.utils import parse_pg_version


class TestUtils:
def test_parse_pg_version(self):
# Linux Mint
assert parse_pg_version("postgres (PostgreSQL) 15.5 (Ubuntu 15.5-1.pgdg22.04+1)") == "15.5"
# Linux Ubuntu
assert parse_pg_version("postgres (PostgreSQL) 12.17") == "12.17"
# Windows
assert parse_pg_version("postgres (PostgreSQL) 11.4") == "11.4"
# Macos
assert parse_pg_version("postgres (PostgreSQL) 14.9 (Homebrew)") == "14.9"
0