mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	unittest environment. Since his extension finds docstrings in private functions, it exposed a bug in the difflib doctests.
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			473 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			473 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import difflib
 | 
						|
from test import test_support
 | 
						|
import unittest
 | 
						|
import doctest
 | 
						|
 | 
						|
class TestSFbugs(unittest.TestCase):
 | 
						|
 | 
						|
    def test_ratio_for_null_seqn(self):
 | 
						|
        # Check clearing of SF bug 763023
 | 
						|
        s = difflib.SequenceMatcher(None, [], [])
 | 
						|
        self.assertEqual(s.ratio(), 1)
 | 
						|
        self.assertEqual(s.quick_ratio(), 1)
 | 
						|
        self.assertEqual(s.real_quick_ratio(), 1)
 | 
						|
 | 
						|
Doctests = doctest.DocTestSuite(difflib)
 | 
						|
 | 
						|
test_support.run_unittest(TestSFbugs, Doctests)
 | 
						|
 |