mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Skip test if socket gets reset, the problem is on the other side.
This commit is contained in:
		
							parent
							
								
									22c6542691
								
							
						
					
					
						commit
						64018ae057
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,8 @@
 | 
			
		|||
#!/usr/bin/env python
 | 
			
		||||
 | 
			
		||||
import errno
 | 
			
		||||
import socket
 | 
			
		||||
import sys
 | 
			
		||||
import unittest
 | 
			
		||||
from test import test_support
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -11,7 +14,14 @@ def test_current_time(self):
 | 
			
		|||
        # Get the current time from xmlrpc.com.  This code exercises
 | 
			
		||||
        # the minimal HTTP functionality in xmlrpclib.
 | 
			
		||||
        server = xmlrpclib.ServerProxy("http://time.xmlrpc.com/RPC2")
 | 
			
		||||
        try:
 | 
			
		||||
            t0 = server.currentTime.getCurrentTime()
 | 
			
		||||
        except socket.error as e:
 | 
			
		||||
            if e.errno != errno.ECONNRESET:
 | 
			
		||||
                raise
 | 
			
		||||
            print("    test_current_time: socket got reset, skipping test",
 | 
			
		||||
                  file=sys.stderr)
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
        # Perform a minimal sanity check on the result, just to be sure
 | 
			
		||||
        # the request means what we think it means.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue