-
Notifications
You must be signed in to change notification settings - Fork 32
Tests: Re-enable doctests, and a few cleanups #753
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
Conversation
The doctests require an older version, because they are missing an authority key identifier.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| Traceback (most recent call last): | ||
| ... | ||
| crate.client.exceptions.DigestNotFoundException: myfiles/041f06fd774092478d450774f5ba30c5da78acc8 | ||
| crate.client.exceptions.DigestNotFoundException: DigestNotFoundException('myfiles/041f06fd774092478d450774f5ba30c5da78acc8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: That adjusts for an anomaly because new code now includes the class name into the serialized string representation. I've also reflected it within a changelog item now.
| Traceback (most recent call last): | ||
| ... | ||
| crate.client.exceptions.BlobLocationNotFoundException: locations/040f06fd774092478d450774f5ba30c5da78acc8 | ||
| crate.client.exceptions.BlobLocationNotFoundException: BlobLocationNotFoundException('locations/040f06fd774092478d450774f5ba30c5da78acc8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito.
|
|
||
| def __str__(self): | ||
| return f"{self.__class__.__qualname__}('{self.table}/{self.digest})'" | ||
| return f"{self.__class__.__qualname__}('{self.table}/{self.digest}')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: That just fixes a little formatting typo discovered when re-enabling doctests.
| # Unit tests. | ||
| suite.addTest(makeSuite(CursorTest)) | ||
| suite.addTest(makeSuite(HttpClientTest)) | ||
| suite.addTest(makeSuite(KeepAliveClientTest)) | ||
| suite.addTest(makeSuite(ThreadSafeHttpClientTest)) | ||
| suite.addTest(makeSuite(ParamsTest)) | ||
| suite.addTest(makeSuite(ConnectionTest)) | ||
| suite.addTest(makeSuite(RetryOnTimeoutServerTest)) | ||
| suite.addTest(makeSuite(RequestsCaBundleTest)) | ||
| suite.addTest(makeSuite(TestUsernameSentAsHeader)) | ||
| suite.addTest(makeSuite(TestCrateJsonEncoder)) | ||
| suite.addTest(makeSuite(TestDefaultSchemaHeader)) | ||
| suite.addTest(doctest.DocTestSuite("crate.client.connection")) | ||
| suite.addTest(doctest.DocTestSuite("crate.client.http")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: The omitted suites are covered by regular pytest test cases now. Thank you @surister!
Before:
myfiles/041f06fd774092478d450774f5ba30c5da78acc8
After:
DigestNotFoundException('myfiles/041f06fd774092478d450774f5ba30c5da78acc8')
This applies to both `DigestNotFoundException` and
`BlobLocationNotFoundException`.
It's usually nothing the end user is concerned with. However, on a stable project, it certainly should be mentioned to indicate potential flaws when packaging a project, but let's spare the details.
This is a library and not an application.
0e517d4 to
20bd23d
Compare
| "ruff<0.15", | ||
| "setuptools>=80.9.0", | ||
| "stopit<1.2", | ||
| "urllib3<2.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: This can be removed after tackling #708.
| "urllib3<2.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch will resolve it.
Problem
It looks like recent refactorings lost the doctests?
What else?
Other than the fix for the problem at hand, the PR also includes a few more other cleanups.