Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support special version#85

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
demonolock merged 1 commit intomasterfromwork-with-non-special-versions
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
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
12 changes: 10 additions & 2 deletionstestgres/utils.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,8 @@
import tempfile

from contextlib import contextmanager
from packaging.version import Version
from packaging.version import Version, InvalidVersion
import re
try:
from shutil import which as find_executable
except ImportError:
Expand All@@ -27,8 +28,15 @@
# ports used by nodes
bound_ports = set()


# re-export version type
PgVer = Version
class PgVer(Version):
def __init__(self, version: str) -> None:
try:
super().__init__(version)
except InvalidVersion:
version = re.sub(r"[a-zA-Z].*", "", version)
super().__init__(version)


def reserve_port():
Expand Down
8 changes: 8 additions & 0 deletionstests/test_simple.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -901,13 +901,21 @@ def test_version_management(self):
d = PgVer('15.0')
e = PgVer('15rc1')
f = PgVer('15beta4')
h = PgVer('15.3biha')
i = PgVer('15.3')
g = PgVer('15.3.1bihabeta1')
k = PgVer('15.3.1')

self.assertTrue(a == b)
self.assertTrue(b > c)
self.assertTrue(a > c)
self.assertTrue(d > e)
self.assertTrue(e > f)
self.assertTrue(d > f)
self.assertTrue(h > f)
self.assertTrue(h == i)
self.assertTrue(g == k)
self.assertTrue(g > h)

version = get_pg_version()
with get_new_node() as node:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp