GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — test: restore and fix shadowed test_discovery_http_is_closed by Capstan · Pull Request #2758 · googleapis/google-api-python-client ConversationThis Pull Request deletes a duplicate test class definition in The Bug (Problem)As reported in #2757, there were two separate definitions for In Python, defining a class twice in the same module causes the second definition to silently overwrite the first. Because of this, the first Furthermore, the original test case was syntactically invalid: it instantiated a regular Historical ContextThis shadowing bug was introduced in September 2020 in commit 98888da ("fix: add method to close httplib2 connections (#1038)"). That commit added As a result, this important connection-lifecycle test has been silently bypassed and inactive in the test suite for over 5 years. The Fix (Solution)
VerificationRan the restored test directly under pytest tests/test_discovery.py::Discovery::test_discovery_http_is_closed Result: Passed successfully. Fixes #2757
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
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. Code ReviewThis pull request relocates and updates the
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. During a cleanup of duplicate 'class Discovery(unittest.TestCase)' definitions in tests/test_discovery.py, we discovered that one of the classes was completely dead code because Python silently overwrites classes with identical names in the same module. This shadowed class contained a connection lifecycle test: 'test_discovery_http_is_closed'. This commit deletes the duplicate class and restores the 'test_discovery_http_is_closed' test inside the active Discovery class. The test case has been corrected to use standard 'mock.patch' on 'httplib2.Http' to successfully assert that build() closes the temporary HTTP client used during dynamic discovery initialization, preventing socket leakage. #jetski AI_USAGE=true
Capstan
force-pushed
the
fix-shadowed-http-close-test
branch
from
ff803e6 to
2575000
Compare
This branch has not been deployedNo deployments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers1 more reviewerAt least 1 approving review is required to merge this pull request. Uh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
size: s
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. test: connection leak test test_discovery_http_is_closed is shadowed and syntactically invalidUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |