Skip to content

Conversation

@chalmerlowe
Copy link
Collaborator

This PR introduces unit tests for the _should_include_class() and _should_include_method() filter functions in generate.py.

These tests ensure the filtering logic behaves as expected ensuring the microgenerator's ability to selectively process classes and methods.

Key changes include:

  • Creation of tests/unit/test_generate_filters.py.
  • Comprehensive test cases covering various include/exclude scenarios for class suffixes and method prefixes.
  • Utilization of @pytest.mark.parametrize with pytest.param() and id to create the test cases.
  • Improved docstrings in generate.py for the tested functions, including examples.

@chalmerlowe chalmerlowe requested review from a team as code owners October 14, 2025 14:22
@chalmerlowe chalmerlowe requested review from mrfaizal and removed request for a team October 14, 2025 14:22
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery API. labels Oct 14, 2025
Args:
class_name: The name of the class to check.
class_filters: A dictionary containing filter rules:
"include_suffixes": List of suffixes. If provided, the class name
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my curiosity, what happens if a class name satisfies both include_suffixes and exclude_suffixes?

@chalmerlowe chalmerlowe merged commit 7effe2c into autogen Oct 15, 2025
21 checks passed
@chalmerlowe chalmerlowe deleted the test/test__should_include_class_or_method branch October 15, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants