mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Remove useless code in doctests (#7733)
* refactor: Fix matrix display deprecation * refactor: Remove useless `print` and `pass` statements * revert: Replace broken doctests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * revert: Fix failing doctests * chore: Satisfy pre-commit Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
501a1cf0c7
commit
61eedc16c3
@ -23,8 +23,6 @@ def get_subreddit_data(
|
||||
limit : Number of posts to fetch
|
||||
age : ["new", "top", "hot"]
|
||||
wanted_data : Get only the required data in the list
|
||||
|
||||
>>> pass
|
||||
"""
|
||||
wanted_data = wanted_data or []
|
||||
if invalid_search_terms := ", ".join(sorted(set(wanted_data) - valid_terms)):
|
||||
|
@ -19,7 +19,6 @@ def get_openlibrary_data(olid: str = "isbn/0140328726") -> dict:
|
||||
{'publishers': ['Puffin'], 'number_of_pages': 96, 'isbn_10': ['0140328726'], ...
|
||||
# >>> get_openlibrary_data(olid='/authors/OL7353617A') # doctest: +ELLIPSIS
|
||||
{'name': 'Adrian Brisku', 'created': {'type': '/type/datetime', ...
|
||||
>>> pass # Placate https://github.com/apps/algorithms-keeper
|
||||
"""
|
||||
new_olid = olid.strip().strip("/") # Remove leading/trailing whitespace & slashes
|
||||
if new_olid.count("/") != 1:
|
||||
@ -29,9 +28,7 @@ def get_openlibrary_data(olid: str = "isbn/0140328726") -> dict:
|
||||
|
||||
def summarize_book(ol_book_data: dict) -> dict:
|
||||
"""
|
||||
Given Open Library book data, return a summary as a Python dict.
|
||||
|
||||
>>> pass # Placate https://github.com/apps/algorithms-keeper
|
||||
Given Open Library book data, return a summary as a Python dict.
|
||||
"""
|
||||
desired_keys = {
|
||||
"title": "Title",
|
||||
|
Reference in New Issue
Block a user