diff --git a/okonomiyaki/file_formats/tests/test__egg_info.py b/okonomiyaki/file_formats/tests/test__egg_info.py index 58d7b05..5f0d7d8 100644 --- a/okonomiyaki/file_formats/tests/test__egg_info.py +++ b/okonomiyaki/file_formats/tests/test__egg_info.py @@ -70,7 +70,7 @@ def test_from_spec_string(self): self.assertEqual(dependency.build_number, 2) self.assertEqual(dependency.strictness, 3) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( InvalidRequirementStringHyphen, "Invalid requirement string {0!r}:" " Package versions should be separated by whitespace" @@ -293,7 +293,7 @@ def test_error_python_to_python_tag(self): packages = []""") # When/Then - with self.assertRaisesRegexp( + with self.assertRaisesRegex( InvalidMetadataField, r"^Invalid value for metadata field 'python': u?'a.7'" ) as exc: @@ -635,7 +635,7 @@ def test_simple_unsupported(self): spec_string = "metadata_version = '1.0'" # When/Then - with self.assertRaisesRegexp( + with self.assertRaisesRegex( InvalidMetadataField, r"^Missing metadata field 'name'" ): parse_rawspec(spec_string) @@ -770,7 +770,7 @@ def test_invalid_spec_strings(self): """ # When/Then - with self.assertRaisesRegexp( + with self.assertRaisesRegex( InvalidMetadataField, r"^Invalid value for metadata field 'metadata_version': None" ): @@ -793,7 +793,7 @@ def test_invalid_spec_strings(self): """ # When/Then - with self.assertRaisesRegexp( + with self.assertRaisesRegex( InvalidMetadataField, r"^Missing metadata field 'platform'" ): parse_rawspec(spec_s) @@ -816,7 +816,7 @@ def test_invalid_spec_strings(self): """ # When/Then - with self.assertRaisesRegexp( + with self.assertRaisesRegex( InvalidMetadataField, r"^Missing metadata field 'python_tag'" ): parse_rawspec(spec_s) diff --git a/okonomiyaki/platforms/tests/test_python_implementation.py b/okonomiyaki/platforms/tests/test_python_implementation.py index e0207ac..254135d 100644 --- a/okonomiyaki/platforms/tests/test_python_implementation.py +++ b/okonomiyaki/platforms/tests/test_python_implementation.py @@ -92,7 +92,7 @@ def test_from_string(self, major, minor, tag_string): def test_from_string_errors(self, data): # When/Then message = r"^Invalid value for metadata field 'python_tag': '{}'$" - with self.assertRaisesRegexp( + with self.assertRaisesRegex( InvalidMetadataField, message.format(data)): PythonImplementation.from_string(data) diff --git a/okonomiyaki/runtimes/tests/test_runtime_metadata.py b/okonomiyaki/runtimes/tests/test_runtime_metadata.py index 7b251a2..f28dfd8 100644 --- a/okonomiyaki/runtimes/tests/test_runtime_metadata.py +++ b/okonomiyaki/runtimes/tests/test_runtime_metadata.py @@ -298,7 +298,7 @@ def test_invalid(self): path = R_DEFAULT_3_0_0_RH5_X86_64 # When/Then - with self.assertRaisesRegexp( + with self.assertRaisesRegex( UnsupportedMetadata, r"^No support for language 'r' \(metadata version '1.0'\)"): runtime_metadata_factory(path) @@ -333,7 +333,7 @@ def test_missing_metadata(self): path = INVALID_RUNTIME_NO_METADATA_VERSION # When/Then - with self.assertRaisesRegexp( + with self.assertRaisesRegex( MissingMetadata, r"^Missing runtime metadata field 'metadata_version'$"): runtime_metadata_factory(path) diff --git a/okonomiyaki/versions/tests/test_enpkg_version.py b/okonomiyaki/versions/tests/test_enpkg_version.py index 1d5cb1e..bdd731a 100644 --- a/okonomiyaki/versions/tests/test_enpkg_version.py +++ b/okonomiyaki/versions/tests/test_enpkg_version.py @@ -68,7 +68,7 @@ def test_from_string_invalid(self): s = "1.3.0-a" # When/Then - with self.assertRaisesRegexp( + with self.assertRaisesRegex( InvalidEnpkgVersion, "Invalid build number: 'a'" ): EnpkgVersion.from_string(s) diff --git a/okonomiyaki/versions/tests/test_semver.py b/okonomiyaki/versions/tests/test_semver.py index 5ab8bd6..942fa11 100644 --- a/okonomiyaki/versions/tests/test_semver.py +++ b/okonomiyaki/versions/tests/test_semver.py @@ -185,7 +185,7 @@ def test_invalid_versions(self): ) # When/Then - with self.assertRaisesRegexp(InvalidSemanticVersion, r_output): + with self.assertRaisesRegex(InvalidSemanticVersion, r_output): SemanticVersion.from_string(version_string) def test_other_object(self):