class_docstr: Tests urllib.request.urlopen using the network.
  
  These tests are not exhaustive.  Assuming that testing using files does a
  good job overall of some of the basic interface features.  There are no
  tests exercising the optional 'data' and 'proxies' arguments.  No tests
  for transparent redirection have been written.
  
  setUp is not used for always constructing a connection to
  http://www.pythontest.net/ since there a few tests that don't use that address
  and making a connection is expensive enough to warrant minimizing unneeded
  connections.
class_docstr_tok: ["Tests","urllib.request.urlopen","using","the","network",".","These","tests","are","not","exhaustive",".","Assuming","that","testing","using","files","does","a","good","job","overall","of","some","of","the","basic","interface","features",".","There","are","no","tests","exercising","the","optional","'data","'","and","'proxies","'","arguments",".","No","tests","for","transparent","redirection","have","been","written",".","setUp","is","not","used","for","always","constructing","a","connection","to","http",":","\/\/www.pythontest.net\/","since","there","a","few","tests","that","do","n't","use","that","address","and","making","a","connection","is","expensive","enough","to","warrant","minimizing","unneeded","connections","."]
code: def test_bad_address(self):
      # Make sure proper exception is raised when connecting to a bogus
      # address.
  
      # Given that both VeriSign and various ISPs have in
      # the past or are presently hijacking various invalid
      # domain name requests in an attempt to boost traffic
      # to their own sites, finding a domain name to use
      # for this test is difficult.  RFC2606 leads one to
      # believe that '.invalid' should work, but experience
      # seemed to indicate otherwise.  Single character
      # TLDs are likely to remain invalid, so this seems to
      # be the best choice. The trailing '.' prevents a
      # related problem: The normal DNS resolver appends
      # the domain names from the search path if there is
      # no '.' the end and, and if one of those domains
      # implements a '*' rule a result is returned.
      # However, none of this will prevent the test from
      # failing if the ISP hijacks all invalid domain
      # requests.  The real solution would be to be able to
      # parameterize the framework with a mock resolver.
      bogus_domain = "sadflkjsasf.i.nvali.d."
      try:
          socket.gethostbyname(bogus_domain)
      except OSError:
          # socket.gaierror is too narrow, since getaddrinfo() may also
          # fail with EAI_SYSTEM and ETIMEDOUT (seen on Ubuntu 13.04),
          # i.e. Python's TimeoutError.
          pass
      else:
          # This happens with some overzealous DNS providers such as OpenDNS
          self.skipTest(
              "%r should not resolve for test to work" % bogus_domain
          )
      failure_explanation = (
          "opening an invalid URL did not raise OSError; "
          "can be caused by a broken DNS server "
          "(e.g. returns 404 or hijacks page)"
      )
      with self.assertRaises(OSError, msg=failure_explanation):
          urllib.request.urlopen("http://{}/".format(bogus_domain))
  
imports: import unittest
  from test import support
  from test.support import os_helper
  from test.support import socket_helper
  import contextlib
  import socket
  import urllib.parse
  import urllib.request
  import os
  import email.message
  import time
label_desc: Use image node_id 8 for calling the urlopenNetworkTests obj's underlying member method code with example usage: obj.test_bad_address() without return types