Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiyuan Chen <chenzhiyuan@dp.tech>
  • Loading branch information
ZhiyuanChen committed May 26, 2023
1 parent 20c1d30 commit f8476d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions testing/test_basic_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest

import setuptools_scm
from datetime import date
from setuptools_scm import Configuration
from setuptools_scm import dump_version
from setuptools_scm._run_cmd import run
Expand Down Expand Up @@ -176,14 +177,14 @@ def read(name: str) -> str:
assert "__version_tuple__ = version_tuple = (1, 0, 'dev42')" in lines

version = "1.0.1+g4ac9d2c"
scm_version = meta(version, config=c)
scm_version = meta("1.0.1", node="g4ac9d2c", config=c)
dump_version(tmp_path, version, scm_version, "second.py")
lines = read("second.py").splitlines()
assert "__version__ = version = '1.0.1+g4ac9d2c'" in lines
assert "__version_tuple__ = version_tuple = (1, 0, 1, 'g4ac9d2c')" in lines

version = "1.2.3.dev18+gb366d8b.d20210415"
scm_version = meta(version, config=c)
scm_version = meta("1.2.3", node="gb366d8b", distance=18, node_date=date(2021, 4, 15), config=c)
dump_version(tmp_path, version, scm_version, "third.py")
lines = read("third.py").splitlines()
assert "__version__ = version = '1.2.3.dev18+gb366d8b.d20210415'" in lines
Expand Down

0 comments on commit f8476d4

Please sign in to comment.