mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 22:44:05 +08:00
test: Checks if the pyproject.toml and __version__ in __init__.py are in sync
This commit is contained in:
@@ -2,12 +2,12 @@ import decimal
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from httprunner import loader, utils
|
import toml
|
||||||
from httprunner.utils import (
|
|
||||||
ExtendJSONEncoder,
|
from httprunner import __version__, loader, utils
|
||||||
merge_variables,
|
from httprunner.utils import ExtendJSONEncoder, merge_variables
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class TestUtils(unittest.TestCase):
|
class TestUtils(unittest.TestCase):
|
||||||
@@ -152,3 +152,11 @@ class TestUtils(unittest.TestCase):
|
|||||||
parameters_content_list = []
|
parameters_content_list = []
|
||||||
product_list = utils.gen_cartesian_product(*parameters_content_list)
|
product_list = utils.gen_cartesian_product(*parameters_content_list)
|
||||||
self.assertEqual(product_list, [])
|
self.assertEqual(product_list, [])
|
||||||
|
|
||||||
|
def test_versions_are_in_sync(self):
|
||||||
|
"""Checks if the pyproject.toml and __version__ in __init__.py are in sync."""
|
||||||
|
|
||||||
|
path = Path(__file__).resolve().parents[1] / "pyproject.toml"
|
||||||
|
pyproject = toml.loads(open(str(path)).read())
|
||||||
|
pyproject_version = pyproject["tool"]["poetry"]["version"]
|
||||||
|
self.assertEqual(pyproject_version, __version__)
|
||||||
|
|||||||
Reference in New Issue
Block a user