Skip to content

Conversation

@MarcSkovMadsen
Copy link
Collaborator

Closing #1063

@MarcSkovMadsen MarcSkovMadsen added this to the v2.x milestone Jul 9, 2025
@MarcSkovMadsen MarcSkovMadsen requested review from Copilot and maximlt July 9, 2025 03:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that error messages for parameters owned by classes using custom metaclasses derived from ParameterizedMetaclass correctly display the class name rather than the metaclass name.

  • Updated _validate_error_prefix to recognize subclasses of ParameterizedMetaclass.
  • Added a new test to verify that custom metaclass names no longer appear in error messages.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/teststringparam.py Added test_reject_none_custom_metaclass to confirm the fix.
param/_utils.py Changed prefix logic to use issubclass for detecting metaclass subclasses.

@maximlt
Copy link
Member

maximlt commented Jul 9, 2025

@MarcSkovMadsen pre-commit is not happy.

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

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

This change makes sense. Thanks for figuring this out and submitting the PR!

@codecov
Copy link

codecov bot commented Jul 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.48%. Comparing base (b1c46e2) to head (63dbbe7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1064   +/-   ##
=======================================
  Coverage   87.48%   87.48%           
=======================================
  Files           9        9           
  Lines        4961     4961           
=======================================
  Hits         4340     4340           
  Misses        621      621           

☔ 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.

@maximlt maximlt merged commit 8c465c0 into main Jul 11, 2025
17 checks passed
@maximlt maximlt deleted the fix/error-message branch July 11, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants