Skip to content

Change r" in match#296

Open
ddevin96 wants to merge 1 commit into
mainfrom
feat/re-escape
Open

Change r" in match#296
ddevin96 wants to merge 1 commit into
mainfrom
feat/re-escape

Conversation

@ddevin96

Copy link
Copy Markdown
Collaborator

All submissions

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there are no other open Pull Requests for the same changes?
  • Have you made sure you have rebased your branch to the latest commit on the target branch?

Description

Change all r" in match in test
Close #286

Checklist

  • Does your submission pass all tests? (use make test)
  • Have you written tests to cover all your changes? If not, provide a reason.
  • Have you lint your code locally before submission? (use make format)
  • Have you type checked your code locally before submission? (use make typecheck)

@ddevin96 ddevin96 marked this pull request as ready for review June 12, 2026 12:27
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

with pytest.warns(
UserWarning,
match=r"Exception occurred during MultiModelTrainer cleanup\. Error: error",
match=re.compile("Exception occurred during MultiModelTrainer cleanup. Error: error"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape here.

with pytest.warns(
UserWarning,
match=r"Exception occurred during MultiModelTrainer cleanup\. Error: error",
match=re.compile("Exception occurred during MultiModelTrainer cleanup. Error: error"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape here.

ValueError,
match=r"Unsupported format for file '.*sample\.txt'. Expected \.json or \.json\.zst",
match=re.compile(
"Unsupported format for file '.*sample\\.txt'. Expected \\.json or \\.json\\.zst"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remove escape \.

names_before = list_datasets()

with pytest.raises(ValueError, match=r"Duplicate preloaded dataset name 'algebra'"):
with pytest.raises(ValueError, match=re.compile("Duplicate preloaded dataset name 'algebra'")):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape here.

def test_load_dataset_rejects_invalid_name():
with (
pytest.raises(ValueError, match=r"Invalid dataset name None"),
pytest.raises(ValueError, match=re.compile("Invalid dataset name None")),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape here.

def test_load_dataset_rejects_invalid_hf_sha():
with (
pytest.raises(ValueError, match=r"Invalid HF_SHA ''"),
pytest.raises(ValueError, match=re.compile("Invalid HF_SHA ''")),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape here.


def test_get_dataset_by_name_rejects_unknown_name():
with pytest.raises(ValueError, match=r"Dataset not found: missing-dataset"):
with pytest.raises(ValueError, match=re.compile("Dataset not found: missing-dataset")):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape here.


def test_colorize_metric_value_rejects_invalid_sort_order():
with pytest.raises(ValueError, match="'sort_order' must be 'asc' or 'des'"):
with pytest.raises(ValueError, match=re.compile("'sort_order' must be 'asc' or 'des'")):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change all r" to re.escape

2 participants