Skip to content

fix: fix test_repr assertion #492

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

Closed
wants to merge 6 commits into from
Closed

fix: fix test_repr assertion #492

wants to merge 6 commits into from

Conversation

vchudnov-g
Copy link
Contributor

python-api-core/tests/unit/test_client_options.py:test_repr() had an assertion that was always True.

Fixes #449

@vchudnov-g vchudnov-g requested a review from atulep March 13, 2023 21:46
@vchudnov-g vchudnov-g requested review from a team as code owners March 13, 2023 21:46
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Mar 13, 2023
@vchudnov-g vchudnov-g added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Mar 13, 2023
@vchudnov-g
Copy link
Contributor Author

Stepping back: the intent appears to be to compare regardless of order, so it's more robust and cleaner to restructure the test to not have branches for possible orderings.

@bcoe
Copy link
Contributor

bcoe commented Apr 19, 2023

Stepping back: the intent appears to be to compare regardless of order, so it's more robust and cleaner to restructure the test to not have branches for possible orderings.

I looked back at when this test was added, and read through the codebase better (based on your most recent feedback on my PR). Really, the goal of the test is to make sure that:

    def __repr__(self):
        return "ClientOptions: " + repr(self.__dict__)

Serializes the class with a ClientOptions prefix, followed by a string representation of the keys. It's overkill IMO to assert that every key is set, let's just switch to a simple regex:

#497

@bcoe
Copy link
Contributor

bcoe commented Apr 20, 2023

Fixed in #449, #492, thanks for your help with review.

@bcoe bcoe closed this Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. size: xs Pull request size is extra small. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assert in test_repr is always true
2 participants