Patch ip test (#2808)

* patch ip test

* changelog
This commit is contained in:
Abubakar Abid 2022-12-13 17:15:14 -06:00 committed by GitHub
parent c126e62970
commit b492212c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -10,7 +10,7 @@ No changes to highlight.
No changes to highlight.
## Testing and Infrastructure Changes:
No changes to highlight.
* Fixed test for IP address by [@abidlabs](https://github.com/abidlabs) in [PR 2808](https://github.com/gradio-app/gradio/pull/2808)
## Breaking Changes:
No changes to highlight.

View File

@ -107,10 +107,7 @@ class TestIPAddress:
ip = get_local_ip_address()
if ip == "No internet connection":
return
try: # check whether ip is valid
ipaddress.ip_address(ip)
except ValueError:
self.fail("Invalid IP address")
ipaddress.ip_address(ip)
@mock.patch("requests.get")
def test_get_ip_without_internet(self, mock_get):