def test_closesResolvConf(self):
        """
        As part of its constructor, C{StubResolver} opens C{/etc/resolv.conf};
        then, explicitly closes it and does not count on the GC to do so for
        it.
        """
        handle = FilePath(self.mktemp())
        resolvConf = handle.open(mode='w+')
        class StubResolver(client.Resolver):
            def _openFile(self, name):
                return resolvConf
        StubResolver(servers=["example.com", 53], resolv='/etc/resolv.conf',
                     reactor=Clock())
        self.assertTrue(resolvConf.closed)

        As part of its constructor, C{StubResolver} opens C{/etc/resolv.conf};
        then, explicitly closes it and does not count on the GC to do so for
        it.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_client.py