diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 339807b..cab6b97 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] steps: - uses: actions/checkout@v2 diff --git a/mathparse/__init__.py b/mathparse/__init__.py index dd526e7..1103506 100644 --- a/mathparse/__init__.py +++ b/mathparse/__init__.py @@ -2,4 +2,4 @@ mathparse is a library for solving mathematical equations contained in strings """ -__version__ = '0.2.6' +__version__ = '0.2.7' diff --git a/pyproject.toml b/pyproject.toml index 9e9e1cf..0f564e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ version = {attr = "mathparse.__version__"} [project] name = "mathparse" -requires-python = ">=3.9,<3.14" +requires-python = ">=3.9,<3.15" urls = { Documentation = "https://mathparse.chatterbot.us", Repository = "https://github.com/gunthercox/mathparse", Changelog = "https://github.com/gunthercox/mathparse/releases" } authors = [ {name = "Gunther Cox"}, diff --git a/tests/test_prefix_unary_operations.py b/tests/test_prefix_unary_operations.py index 70073d1..07376ed 100644 --- a/tests/test_prefix_unary_operations.py +++ b/tests/test_prefix_unary_operations.py @@ -155,7 +155,13 @@ def test_sqrt_with_negative_causes_math_error(self): # Verify it causes the expected math error with self.assertRaises(ValueError) as context: mathparse.parse('sqrt -16') - self.assertIn("math domain error", str(context.exception).lower()) + # Python 3.14+ uses more specific error messages + error_msg = str(context.exception).lower() + self.assertTrue( + "math domain error" in error_msg or + "expected a nonnegative input" in error_msg, + f"Unexpected error message: {error_msg}" + ) def test_log_with_negative_causes_math_error(self): """ @@ -168,7 +174,13 @@ def test_log_with_negative_causes_math_error(self): # Verify it causes the expected math error with self.assertRaises(ValueError) as context: mathparse.parse('log -10') - self.assertIn("math domain error", str(context.exception).lower()) + # Python 3.14+ uses more specific error messages + error_msg = str(context.exception).lower() + self.assertTrue( + "math domain error" in error_msg or + "expected a positive input" in error_msg, + f"Unexpected error message: {error_msg}" + ) def test_sqrt_with_positive_after_operator(self): """