Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop use of deprecated alias assertRaisesRegexp #468

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions okonomiyaki/file_formats/tests/test__egg_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
):
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion okonomiyaki/platforms/tests/test_python_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions okonomiyaki/runtimes/tests/test_runtime_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion okonomiyaki/versions/tests/test_enpkg_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion okonomiyaki/versions/tests/test_semver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading