def test_replace_version_errors(): with pytest.raises(ValueError, match="does not match current version"): modules.replace_version(old="v0.11.0", new="v0.11.1") with pytest.raises(ValueError, match="va.b.c is not a valid version number"): modules.replace_version(old="1.2.3.dev", new="va.b.c")
def test_get_version_on_inconsistent_version_modules(): modules.replace_version(search_dir=Path("./mod2"), old="1.2.3.dev", new="1.2.4.dev") assert modules.get_version(search_dir=Path("./mod2")) == "1.2.4.dev" with pytest.raises(ValueError, match="Versions should be the same, instead:"): modules.get_version(search_dir=Path("."))
def test_replace_version(tmpdir_factory): assert modules.get_version() == "1.2.3.dev" modules.replace_version(old="1.2.3.dev", new="1.2.4.dev") assert modules.get_version() == "1.2.4.dev"