Skip to content

tests(nano): fix usage of raises with match#1341

Merged
glevco merged 1 commit intomasterfrom
tests/nano/raises-match
Jul 31, 2025
Merged

tests(nano): fix usage of raises with match#1341
glevco merged 1 commit intomasterfrom
tests/nano/raises-match

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Jul 30, 2025

Motivation

The self.assertRaises method doesn't support the match arg for checking exception messages, only the pytest.raises function. This PRs fixes all incorrect usages.

Acceptance Criteria

  • Replace self.assertRaises with pytest.raises in files where the match arg is used.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this Jul 30, 2025
@glevco glevco requested review from jansegre and msbrogli as code owners July 30, 2025 22:05
@glevco glevco moved this from Todo to In Progress (Done) in Hathor Network Jul 30, 2025
@github-actions
Copy link

github-actions bot commented Jul 30, 2025

🐰 Bencher Report

Branchtests/nano/raises-match
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
minutes (m)
(Result Δ%)
Lower Boundary
minutes (m)
(Limit %)
Upper Boundary
minutes (m)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
1.70 m
(+3.48%)Baseline: 1.64 m
1.48 m
(86.98%)
1.80 m
(94.07%)
🐰 View full continuous benchmarking report in Bencher

@codecov
Copy link

codecov bot commented Jul 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.60%. Comparing base (b6c08cd) to head (f4922bc).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1341      +/-   ##
==========================================
- Coverage   85.62%   85.60%   -0.03%     
==========================================
  Files         424      424              
  Lines       32119    32119              
  Branches     4997     4997              
==========================================
- Hits        27502    27495       -7     
- Misses       3614     3616       +2     
- Partials     1003     1008       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@jansegre jansegre left a comment

Choose a reason for hiding this comment

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

Are these all cases? If they are should we add a custom linter to prevent using self.assertRaises?

@github-project-automation github-project-automation bot moved this from In Progress (Done) to In Review (WIP) in Hathor Network Jul 31, 2025
@glevco glevco force-pushed the tests/nano/raises-match branch from 73882a3 to f4922bc Compare July 31, 2025 16:47
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Jul 31, 2025
@glevco
Copy link
Contributor Author

glevco commented Jul 31, 2025

@jansegre

Are these all cases? If they are should we add a custom linter to prevent using self.assertRaises?

Those are all cases that were using assertRaises + the match argument, but not all cases of assertRaises. I think that linter would be great, but we would need another PR to remove all usages, and since it would be a big one (even though it would be simple), I decided it was not a priority now.

@glevco glevco merged commit 8849a23 into master Jul 31, 2025
7 of 8 checks passed
@glevco glevco deleted the tests/nano/raises-match branch July 31, 2025 18:28
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Jul 31, 2025
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Aug 5, 2025
This was referenced Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants