diff --git a/setup.cfg b/setup.cfg index c831f0bd..97a72546 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,8 +49,8 @@ install_requires = Authlib>=1.2.0 rich typer - pydantic>=1.10.12,<2.0 - safety_schemas>=0.0.1 + pydantic>=1.10.12 + safety_schemas>=0.0.2 typing-extensions>=4.7.1 [options.entry_points] diff --git a/test_requirements.txt b/test_requirements.txt index 3d5e5b53..f1cc7af2 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -16,6 +16,6 @@ marshmallow>=3.15.0; python_version>="3.7" Authlib>=1.2.0 rich typer -pydantic>=1.10.12,<2.0 -safety_schemas>=0.0.1 +pydantic>=1.10.12 +safety_schemas>=0.0.2 typing-extensions>=4.7.1 diff --git a/tests/test_cli.py b/tests/test_cli.py index 82601188..f704824d 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -285,11 +285,9 @@ def test_validate_with_policy_file_using_invalid_keyword(self): path = os.path.join(dirname, "test_policy_file", "v3_0", filename) result = self.runner.invoke(cli.cli, ['validate', 'policy_file', '3.0', '--path', path]) cleaned_stdout = click.unstyle(result.stderr) - msg_hint = 'report -> dependency-vulnerabilities -> transitive\n' \ - ' extra fields not permitted (type=value_error.extra)\n' - msg = f'Unable to load the Safety Policy file ("{path}"), this command only supports version 3.0, details: 1 validation error for Config\n{msg_hint}' + msg = f'Unable to load the Safety Policy file ("{path}"), this command only supports version 3.0, details: 1 validation error for Config' - self.assertEqual(msg, cleaned_stdout) + self.assertIn(msg, cleaned_stdout) self.assertEqual(result.exit_code, 1) diff --git a/tests/test_safety.py b/tests/test_safety.py index ba0debcc..2826932c 100644 --- a/tests/test_safety.py +++ b/tests/test_safety.py @@ -466,6 +466,7 @@ def test_get_announcements_catch_unhandled_http_codes(self, get_used_options): @patch("safety.util.get_used_options") @patch.object(click, 'get_current_context', Mock(command=Mock(name=Mock(return_value='check')))) def test_get_announcements_http_ok(self, get_used_options): + get_used_options.return_value = {} announcements = { "announcements": [{