================================================================================================================= FAILURES ================================================================================================================== _________________________________________________________________________________________________ test_database_specify[ngc 3642-db_dict0] __________________________________________________________________________________________________ name = 'ngc 3642' db_dict = {'all': '# ngc3642 #Q22523722 #=S=Simbad (via url): 1 %@ 503952 %I.0 NGC 3642 %C.0 LIN %C.N0 15.15.01.00 %J 170....V=VizieR (local): 1 %J 170.56 +59.08 = 11:22.2 +59:05 %I.0 {NGC} 3642 #====Done (2013-Feb-12,16:37:42z)===='} @remote_data @pytest.mark.parametrize(("name", "db_dict"), [('ngc 3642', _cached_ngc3642), ('castor', _cached_castor)]) def test_database_specify(name, db_dict): # First check that at least some sesame mirror is up for url in sesame_url.get(): if urllib.request.urlopen(url).getcode() == 200: break else: pytest.skip("All SESAME mirrors appear to be down, skipping " "test_name_resolve.py:test_database_specify()...") for db in db_dict.keys(): with sesame_database.set(db): > icrs = SkyCoord.from_name(name) anaconda/lib/python2.7/site-packages/astropy-1.2.dev15333-py2.7-linux-x86_64.egg/astropy/coordinates/tests/test_name_resolve.py:157: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ anaconda/lib/python2.7/site-packages/astropy-1.2.dev15333-py2.7-linux-x86_64.egg/astropy/coordinates/sky_coordinate.py:1178: in from_name icrs_coord = get_icrs_coordinates(name) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'ngc 3642' def get_icrs_coordinates(name): """ Retrieve an ICRS object by using an online name resolving service to retrieve coordinates for the specified name. By default, this will search all available databases until a match is found. If you would like to specify the database, use the science state ``astropy.coordinates.name_resolve.sesame_database``. You can also specify a list of servers to use for querying Sesame using the science state ``astropy.coordinates.name_resolve.sesame_url``. This will try each one in order until a valid response is returned. By default, this list includes the main Sesame host and a mirror at vizier. The configuration item `astropy.utils.data.Conf.remote_timeout` controls the number of seconds to wait for a response from the server before giving up. Parameters ---------- name : str The name of the object to get coordinates for, e.g. ``'M42'``. Returns ------- coord : `astropy.coordinates.ICRS` object The object's coordinates in the ICRS frame. """ database = sesame_database.get() # The web API just takes the first letter of the database name db = database.upper()[0] # Make sure we don't have duplicates in the url list urls = [] domains = [] for url in sesame_url.get(): domain = urllib.parse.urlparse(url).netloc # Check for duplicates if domain not in domains: domains.append(domain) # Add the query to the end of the url, add to url list fmt_url = os.path.join(url, "{db}?{name}") fmt_url = fmt_url.format(name=urllib.parse.quote(name), db=db) urls.append(fmt_url) for url in urls: try: # Retrieve ascii name resolve data from CDS resp = urllib.request.urlopen(url, timeout=data.conf.remote_timeout) resp_data = resp.read() break except urllib.error.URLError as e: # This catches a timeout error, see: # http://stackoverflow.com/questions/2712524/handling-urllib2s-timeout-python if isinstance(e.reason, socket.timeout): # If it was a timeout, try with the next URL continue else: raise NameResolveError( "Unable to retrieve coordinates for name '{0}'; " "connection timed out".format(name)) except socket.timeout: # There are some cases where urllib2 does not catch socket.timeout # especially while receiving response data on an already previously # working request raise NameResolveError( "Unable to retrieve coordinates for name '{0}'; connection " "timed out".format(name)) # All Sesame URL's timed out... else: raise NameResolveError("All Sesame queries timed out. Unable to " "retrieve coordinates.") ra, dec = _parse_response(resp_data) if ra is None and dec is None: if db == "A": err = "Unable to find coordinates for name '{0}'".format(name) else: err = "Unable to find coordinates for name '{0}' in database {1}"\ .format(name, database) > raise NameResolveError(err) E NameResolveError: Unable to find coordinates for name 'ngc 3642' in database vizier anaconda/lib/python2.7/site-packages/astropy-1.2.dev15333-py2.7-linux-x86_64.egg/astropy/coordinates/name_resolve.py:173: NameResolveError _________________________________________________________________________________________________ test_database_specify[ngc 3642-db_dict0] __________________________________________________________________________________________________ name = 'ngc 3642' db_dict = {'all': '# ngc3642 #Q22523722\n#=S=Simbad (via url): 1\n%@ 503952\n%I.0 NGC 3642\n%C.0 LIN\n%C.N0 15.15.01.00\n%...eR (local): 1\n%J 170.56 +59.08 = 11:22.2 +59:05\n%I.0 {NGC} 3642\n\n\n\n#====Done (2013-Feb-12,16:37:42z)===='} @remote_data @pytest.mark.parametrize(("name", "db_dict"), [('ngc 3642', _cached_ngc3642), ('castor', _cached_castor)]) def test_database_specify(name, db_dict): # First check that at least some sesame mirror is up for url in sesame_url.get(): if urllib.request.urlopen(url).getcode() == 200: break else: pytest.skip("All SESAME mirrors appear to be down, skipping " "test_name_resolve.py:test_database_specify()...") for db in db_dict.keys(): with sesame_database.set(db): > icrs = SkyCoord.from_name(name) anaconda/lib/python2.7/site-packages/astropy-1.2.dev15333-py2.7-linux-x86_64.egg/astropy/coordinates/tests/test_name_resolve.py:157: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ anaconda/lib/python2.7/site-packages/astropy-1.2.dev15333-py2.7-linux-x86_64.egg/astropy/coordinates/sky_coordinate.py:1178: in from_name icrs_coord = get_icrs_coordinates(name) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'ngc 3642' def get_icrs_coordinates(name): """ Retrieve an ICRS object by using an online name resolving service to retrieve coordinates for the specified name. By default, this will search all available databases until a match is found. If you would like to specify the database, use the science state ``astropy.coordinates.name_resolve.sesame_database``. You can also specify a list of servers to use for querying Sesame using the science state ``astropy.coordinates.name_resolve.sesame_url``. This will try each one in order until a valid response is returned. By default, this list includes the main Sesame host and a mirror at vizier. The configuration item `astropy.utils.data.Conf.remote_timeout` controls the number of seconds to wait for a response from the server before giving up. Parameters ---------- name : str The name of the object to get coordinates for, e.g. ``'M42'``. Returns ------- coord : `astropy.coordinates.ICRS` object The object's coordinates in the ICRS frame. """ database = sesame_database.get() # The web API just takes the first letter of the database name db = database.upper()[0] # Make sure we don't have duplicates in the url list urls = [] domains = [] for url in sesame_url.get(): domain = urllib.parse.urlparse(url).netloc # Check for duplicates if domain not in domains: domains.append(domain) # Add the query to the end of the url, add to url list fmt_url = os.path.join(url, "{db}?{name}") fmt_url = fmt_url.format(name=urllib.parse.quote(name), db=db) urls.append(fmt_url) for url in urls: try: # Retrieve ascii name resolve data from CDS resp = urllib.request.urlopen(url, timeout=data.conf.remote_timeout) resp_data = resp.read() break except urllib.error.URLError as e: # This catches a timeout error, see: # http://stackoverflow.com/questions/2712524/handling-urllib2s-timeout-python if isinstance(e.reason, socket.timeout): # If it was a timeout, try with the next URL continue else: raise NameResolveError( "Unable to retrieve coordinates for name '{0}'; " "connection timed out".format(name)) except socket.timeout: # There are some cases where urllib2 does not catch socket.timeout # especially while receiving response data on an already previously # working request raise NameResolveError( "Unable to retrieve coordinates for name '{0}'; connection " "timed out".format(name)) # All Sesame URL's timed out... else: raise NameResolveError("All Sesame queries timed out. Unable to " "retrieve coordinates.") ra, dec = _parse_response(resp_data) if ra is None and dec is None: if db == "A": err = "Unable to find coordinates for name '{0}'".format(name) else: err = "Unable to find coordinates for name '{0}' in database {1}"\ .format(name, database) > raise NameResolveError(err) E NameResolveError: Unable to find coordinates for name 'ngc 3642' in database vizier anaconda/lib/python2.7/site-packages/astropy-1.2.dev15333-py2.7-linux-x86_64.egg/astropy/coordinates/name_resolve.py:173: NameResolveError __________________________________________________________________________________________________ TestFileFunctions.test_open_nonexistent __________________________________________________________________________________________________ self = def test_open_nonexistent(self): """Test that trying to open a non-existent file results in an IOError (and not some other arbitrary exception). """ try: fits.open(self.temp('foobar.fits')) except IOError as e: > assert 'No such file or directory' in str(e) E assert 'No such file or directory' in "[Errno 2] Datei oder Verzeichnis nicht gefunden: '/tmp/fits-test-JrSHoi/foobar.fits'" E + where "[Errno 2] Datei oder Verzeichnis nicht gefunden: '/tmp/fits-test-JrSHoi/foobar.fits'" = str(IOError(2, 'Datei oder Verzeichnis nicht gefunden')) anaconda/lib/python2.7/site-packages/astropy-1.2.dev15333-py2.7-linux-x86_64.egg/astropy/io/fits/tests/test_core.py:598: AssertionError ===================================================================================== 3 failed, 10649 passed, 78 skipped, 42 xfailed in 393.88 seconds ====================================================================================== 1