-
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
Changes from all commits
c2882ad
54d4476
6f4ac40
e6188dd
38c150d
a1c6aea
0f6f0be
20bd23d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ coverage.xml | |
| .installed.cfg | ||
| .tox/ | ||
| *.DS_Store | ||
| *.lock | ||
| *.pyc | ||
| bin/* | ||
| !bin/test | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,7 +118,7 @@ Trying to get a non-existing blob throws an exception: | |
| >>> http_client.blob_get('myfiles', '041f06fd774092478d450774f5ba30c5da78acc8') | ||
| Traceback (most recent call last): | ||
| ... | ||
| crate.client.exceptions.DigestNotFoundException: myfiles/041f06fd774092478d450774f5ba30c5da78acc8 | ||
| crate.client.exceptions.DigestNotFoundException: DigestNotFoundException('myfiles/041f06fd774092478d450774f5ba30c5da78acc8') | ||
|
|
||
| Creating a new blob - this method returns ``True`` if the blob was newly created: | ||
|
|
||
|
|
@@ -173,7 +173,7 @@ Uploading a blob to a table with disabled blob support throws an exception: | |
| ... 'locations', '040f06fd774092478d450774f5ba30c5da78acc8', f) | ||
| Traceback (most recent call last): | ||
| ... | ||
| crate.client.exceptions.BlobLocationNotFoundException: locations/040f06fd774092478d450774f5ba30c5da78acc8 | ||
| crate.client.exceptions.BlobLocationNotFoundException: BlobLocationNotFoundException('locations/040f06fd774092478d450774f5ba30c5da78acc8') | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dito. |
||
|
|
||
| >>> http_client.close() | ||
| >>> f.close() | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -34,21 +34,46 @@ classifiers = [ | |||
| ] | ||||
| dependencies = [ | ||||
| "orjson>=3.11.3", | ||||
| "urllib3>=2.5.0", | ||||
| "urllib3", | ||||
| "verlib2>=0.3.1", | ||||
| ] | ||||
|
|
||||
| [dependency-groups] | ||||
| dev = [ | ||||
| "certifi>=2025.10.5", | ||||
| "coverage<8", | ||||
| "mypy<1.19", | ||||
| "poethepoet<1", | ||||
| "pytest<9", | ||||
| "pytest-cov<8", | ||||
| "pytz>=2025.2", | ||||
| "ruff<0.15", | ||||
| "setuptools>=80.9.0", | ||||
| "stopit<1.2", | ||||
| "urllib3<2.4", | ||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: This can be removed after tackling #708.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This patch will resolve it. |
||||
| ] | ||||
|
|
||||
|
|
||||
| [tool.coverage.run] | ||||
| branch = false | ||||
| omit = [ | ||||
| "tests/*", | ||||
| ] | ||||
| parallel = true | ||||
| source = [ "src" ] | ||||
|
|
||||
| [tool.coverage.report] | ||||
| fail_under = 0 | ||||
| show_missing = true | ||||
| exclude_lines = [ | ||||
| "# pragma: no cover", | ||||
| "raise NotImplemented", | ||||
| ] | ||||
| omit = [ | ||||
| "*/.buildout/eggs/*", | ||||
| "buildout-cache/eggs/*", | ||||
| "eggs/*", | ||||
| "parts/*", | ||||
| "src/crate/client/_pep440.py", | ||||
| ] | ||||
|
|
||||
|
|
||||
|
|
@@ -68,6 +93,20 @@ namespace_packages = true | |||
| non_interactive = true | ||||
|
|
||||
|
|
||||
| [tool.pytest.ini_options] | ||||
| addopts = "-rA --verbosity=3" | ||||
| minversion = "2.0" | ||||
| log_level = "DEBUG" | ||||
| log_cli_level = "DEBUG" | ||||
| testpaths = [ | ||||
| "src", | ||||
| "tests", | ||||
| ] | ||||
| xfail_strict = true | ||||
| markers = [ | ||||
| ] | ||||
|
|
||||
|
|
||||
| [tool.ruff] | ||||
| line-length = 80 | ||||
|
|
||||
|
|
@@ -161,5 +200,10 @@ lint = [ | |||
| ] | ||||
|
|
||||
| test = [ | ||||
| { cmd = "bin/test" }, | ||||
| { cmd = "coverage erase" }, | ||||
| { cmd = "coverage run -m pytest" }, | ||||
| { cmd = "coverage run bin/test" }, | ||||
| { cmd = "coverage combine" }, | ||||
| { cmd = "coverage xml" }, | ||||
| { cmd = "coverage report" }, | ||||
| ] | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| setuptools<80.3 | ||
| urllib3<2.4 | ||
| zc.buildout==5.1.1 | ||
| zope.interface==8.1.1 | ||
| zope.testrunner>=5,<8 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,7 +86,7 @@ def __init__(self, table, digest): | |
| self.digest = digest | ||
|
|
||
| def __str__(self): | ||
| return f"{self.__class__.__qualname__}('{self.table}/{self.digest})'" | ||
| return f"{self.__class__.__qualname__}('{self.table}/{self.digest}')" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
|
|
||
| class DigestNotFoundException(BlobException): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.