Skip to content

Commit 5e01edf

Browse files
author
Evert
committed
Fix versioning tests with explicit MAIN_BRANCH_VERSIONING values
1 parent 42de4f8 commit 5e01edf

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/fast/test_versioning.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,29 +109,26 @@ def test_bump_version_exact_tag(self):
109109
assert _bump_version("1.2.3", 0, False) == "1.2.3"
110110
assert _bump_version("1.2.3.post1", 0, False) == "1.2.3.post1"
111111

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

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

120120
@patch.dict('os.environ', {'MAIN_BRANCH_VERSIONING': '0'})
121121
def test_bump_version_release_branch(self):
122-
"""Test bump_version on release branch (MAIN_BRANCH_VERSIONING=False)."""
123-
# Need to reload the module to pick up the environment variable
124-
import importlib
125-
from duckdb_packaging import setuptools_scm_version
126-
importlib.reload(setuptools_scm_version)
127-
128-
assert setuptools_scm_version._bump_version("1.2.3", 5, False) == "1.2.4.dev5"
122+
"""Test bump_version on bugfix branch."""
123+
assert _bump_version("1.2.3", 5, False) == "1.2.4.dev5"
129124

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

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

0 commit comments

Comments
 (0)