-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from iwanbolzern/main
feat: support UV_DYNAMIC_VERSIONING_BYPASS to bypass version resolution
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
from uv_dynamic_versioning import schemas | ||
from uv_dynamic_versioning.main import get_version | ||
|
||
|
||
@pytest.fixture | ||
def version(): | ||
return "1.1.1" | ||
|
||
|
||
@pytest.fixture | ||
def set_uv_dynamic_versioning_bypass(version: str): | ||
os.environ["UV_DYNAMIC_VERSIONING_BYPASS"] = version | ||
|
||
try: | ||
yield version | ||
finally: | ||
del os.environ["UV_DYNAMIC_VERSIONING_BYPASS"] | ||
|
||
|
||
@pytest.mark.usefixtures("set_uv_dynamic_versioning_bypass") | ||
def test_get_version(version: str): | ||
got = get_version(schemas.UvDynamicVersioning()).unwrap() | ||
assert got == version |