I noticed this when working on fixing #46. When I run python3 setup.py test, I get the following warning in the test output:
test_instance_ip_grouping_key (tests.test_client.TestPushGateway) ... tests/test_client.py:478: ResourceWarning: unclosed <socket.socket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('127.0.0.1', 58422)>
self.assertTrue('' != instance_ip_grouping_key()['instance'])
I can also reproduce this warning outside of the tests by running python3 -Wdefault and then calling instance_ip_grouping_key.
Should this function explicitly close the socket it opens instead of relying on it to be cleaned up automatically?
I noticed this when working on fixing #46. When I run
python3 setup.py test, I get the following warning in the test output:I can also reproduce this warning outside of the tests by running
python3 -Wdefaultand then callinginstance_ip_grouping_key.Should this function explicitly close the socket it opens instead of relying on it to be cleaned up automatically?