Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

fix: fix test_repr assertion#492

Closed
vchudnov-g wants to merge 6 commits intomainfrom
vchudnov-g-patch-1
Closed

fix: fix test_repr assertion#492
vchudnov-g wants to merge 6 commits intomainfrom
vchudnov-g-patch-1

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 a review from a team as a code owner March 13, 2023 21:46
@vchudnov-g vchudnov-g requested a review from a team 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

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

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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