Skip to content
Merged
Changes from all 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
13 changes: 5 additions & 8 deletions tests/fast/test_versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,26 @@ def test_bump_version_exact_tag(self):
assert _bump_version("1.2.3", 0, False) == "1.2.3"
assert _bump_version("1.2.3.post1", 0, False) == "1.2.3.post1"

@patch.dict('os.environ', {'MAIN_BRANCH_VERSIONING': '1'})
def test_bump_version_with_distance(self):
"""Test bump_version with distance from tag."""
# Main branch versioning (default)
assert _bump_version("1.2.3", 5, False) == "1.3.0.dev5"

# Post-release development
assert _bump_version("1.2.3.post1", 3, False) == "1.2.3.post2.dev3"

@patch.dict('os.environ', {'MAIN_BRANCH_VERSIONING': '0'})
def test_bump_version_release_branch(self):
"""Test bump_version on release branch (MAIN_BRANCH_VERSIONING=False)."""
# Need to reload the module to pick up the environment variable
import importlib
from duckdb_packaging import setuptools_scm_version
importlib.reload(setuptools_scm_version)

assert setuptools_scm_version._bump_version("1.2.3", 5, False) == "1.2.4.dev5"
"""Test bump_version on bugfix branch."""
assert _bump_version("1.2.3", 5, False) == "1.2.4.dev5"

@patch.dict('os.environ', {'MAIN_BRANCH_VERSIONING': '1'})
def test_bump_version_dirty(self):
"""Test bump_version with dirty working directory."""
assert _bump_version("1.2.3", 0, True) == "1.3.0.dev0"
assert _bump_version("1.2.3.post1", 0, True) == "1.2.3.post2.dev0"

@patch.dict('os.environ', {'MAIN_BRANCH_VERSIONING': '1'})
def test_version_scheme_function(self):
"""Test the version_scheme function that setuptools_scm calls."""
# Mock setuptools_scm version object
Expand Down