示例#1
0
def test_version8():
    with open("test/__init__.py", "w", encoding="utf-8") as f:
        f.write("import abc\n___version__ = '0.1.1d19'\n\n# 测试")

    change_version(3, True)

    with open("test/__init__.py", encoding="utf-8") as f:
        assert f.read() == "import abc\n___version__ = '0.1.1d20'\n\n# 测试"
示例#2
0
def test_version1():
    with open("test/__init__.py", "w", encoding="utf-8") as f:
        f.write("___version__ = '0.1.1'\n\n# 测试")

    change_version(3)

    with open("test/__init__.py", encoding="utf-8") as f:
        assert f.read() == "___version__ = '0.1.2'\n\n# 测试"
示例#3
0
def test_version9(join_root_dir):
    with open(join_root_dir("testdata/__init__.py"), "w",
              encoding="utf-8") as f:
        f.write("import abc\n___version__ = '0.1.1d20'\n\n# 测试")

    change_version(2, package_name=join_root_dir("testdata"))

    with open(join_root_dir("testdata/__init__.py"), encoding="utf-8") as f:
        assert f.read() == "import abc\n___version__ = '0.2.0'   \n\n# 测试"
示例#4
0
def test_version1(join_root_dir):
    with open(join_root_dir("testdata/__init__.py"), "w",
              encoding="utf-8") as f:
        f.write("___version__ = '0.1.1'\n\n# 测试")

    change_version(3, package_name=join_root_dir("testdata"))

    with open(join_root_dir("testdata/__init__.py"), encoding="utf-8") as f:
        assert f.read() == "___version__ = '0.1.2'\n\n# 测试"
示例#5
0
def test_version5():
    with open("test/__init__.py", "w", encoding="utf-8") as f:
        f.write("import abc\n___version__ = '0.1.1d'\n\n# 测试")
    with pytest.raises(RuntimeError):
        change_version(3, True)