mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Issue #17516: do not create useless tuple: remove dummy commas in tests
This commit is contained in:
		
							parent
							
								
									765531d2d0
								
							
						
					
					
						commit
						3fa1aaebde
					
				
					 4 changed files with 11 additions and 11 deletions
				
			
		| 
						 | 
					@ -120,10 +120,10 @@ def test_precomputed(self):
 | 
				
			||||||
    def test_negative_lo(self):
 | 
					    def test_negative_lo(self):
 | 
				
			||||||
        # Issue 3301
 | 
					        # Issue 3301
 | 
				
			||||||
        mod = self.module
 | 
					        mod = self.module
 | 
				
			||||||
        self.assertRaises(ValueError, mod.bisect_left, [1, 2, 3], 5, -1, 3),
 | 
					        self.assertRaises(ValueError, mod.bisect_left, [1, 2, 3], 5, -1, 3)
 | 
				
			||||||
        self.assertRaises(ValueError, mod.bisect_right, [1, 2, 3], 5, -1, 3),
 | 
					        self.assertRaises(ValueError, mod.bisect_right, [1, 2, 3], 5, -1, 3)
 | 
				
			||||||
        self.assertRaises(ValueError, mod.insort_left, [1, 2, 3], 5, -1, 3),
 | 
					        self.assertRaises(ValueError, mod.insort_left, [1, 2, 3], 5, -1, 3)
 | 
				
			||||||
        self.assertRaises(ValueError, mod.insort_right, [1, 2, 3], 5, -1, 3),
 | 
					        self.assertRaises(ValueError, mod.insort_right, [1, 2, 3], 5, -1, 3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_large_range(self):
 | 
					    def test_large_range(self):
 | 
				
			||||||
        # Issue 13496
 | 
					        # Issue 13496
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -98,9 +98,9 @@ def test_run_module(self):
 | 
				
			||||||
        assert_python_failure('-m', 'fnord43520xyz')
 | 
					        assert_python_failure('-m', 'fnord43520xyz')
 | 
				
			||||||
        # Check the runpy module also gives an error for
 | 
					        # Check the runpy module also gives an error for
 | 
				
			||||||
        # a nonexistent module
 | 
					        # a nonexistent module
 | 
				
			||||||
        assert_python_failure('-m', 'runpy', 'fnord43520xyz'),
 | 
					        assert_python_failure('-m', 'runpy', 'fnord43520xyz')
 | 
				
			||||||
        # All good if module is located and run successfully
 | 
					        # All good if module is located and run successfully
 | 
				
			||||||
        assert_python_ok('-m', 'timeit', '-n', '1'),
 | 
					        assert_python_ok('-m', 'timeit', '-n', '1')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_run_module_bug1764407(self):
 | 
					    def test_run_module_bug1764407(self):
 | 
				
			||||||
        # -m and -i need to play well together
 | 
					        # -m and -i need to play well together
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1086,7 +1086,7 @@ def check(tests, byteorder, signed=False):
 | 
				
			||||||
        self.assertRaises(OverflowError, (256).to_bytes, 1, 'big', signed=True)
 | 
					        self.assertRaises(OverflowError, (256).to_bytes, 1, 'big', signed=True)
 | 
				
			||||||
        self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=False)
 | 
					        self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=False)
 | 
				
			||||||
        self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=True)
 | 
					        self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=True)
 | 
				
			||||||
        self.assertRaises(OverflowError, (-1).to_bytes, 2, 'big', signed=False),
 | 
					        self.assertRaises(OverflowError, (-1).to_bytes, 2, 'big', signed=False)
 | 
				
			||||||
        self.assertRaises(OverflowError, (-1).to_bytes, 2, 'little', signed=False)
 | 
					        self.assertRaises(OverflowError, (-1).to_bytes, 2, 'little', signed=False)
 | 
				
			||||||
        self.assertEqual((0).to_bytes(0, 'big'), b'')
 | 
					        self.assertEqual((0).to_bytes(0, 'big'), b'')
 | 
				
			||||||
        self.assertEqual((1).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x01')
 | 
					        self.assertEqual((1).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x01')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -730,7 +730,7 @@ def test_ambiguous_option(self):
 | 
				
			||||||
    def test_short_and_long_option_split(self):
 | 
					    def test_short_and_long_option_split(self):
 | 
				
			||||||
        self.assertParseOK(["-a", "xyz", "--foo", "bar"],
 | 
					        self.assertParseOK(["-a", "xyz", "--foo", "bar"],
 | 
				
			||||||
                           {'a': 'xyz', 'boo': None, 'foo': ["bar"]},
 | 
					                           {'a': 'xyz', 'boo': None, 'foo': ["bar"]},
 | 
				
			||||||
                           []),
 | 
					                           [])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_short_option_split_long_option_append(self):
 | 
					    def test_short_option_split_long_option_append(self):
 | 
				
			||||||
        self.assertParseOK(["--foo=bar", "-b", "123", "--foo", "baz"],
 | 
					        self.assertParseOK(["--foo=bar", "-b", "123", "--foo", "baz"],
 | 
				
			||||||
| 
						 | 
					@ -740,15 +740,15 @@ def test_short_option_split_long_option_append(self):
 | 
				
			||||||
    def test_short_option_split_one_positional_arg(self):
 | 
					    def test_short_option_split_one_positional_arg(self):
 | 
				
			||||||
        self.assertParseOK(["-a", "foo", "bar"],
 | 
					        self.assertParseOK(["-a", "foo", "bar"],
 | 
				
			||||||
                           {'a': "foo", 'boo': None, 'foo': None},
 | 
					                           {'a': "foo", 'boo': None, 'foo': None},
 | 
				
			||||||
                           ["bar"]),
 | 
					                           ["bar"])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_short_option_consumes_separator(self):
 | 
					    def test_short_option_consumes_separator(self):
 | 
				
			||||||
        self.assertParseOK(["-a", "--", "foo", "bar"],
 | 
					        self.assertParseOK(["-a", "--", "foo", "bar"],
 | 
				
			||||||
                           {'a': "--", 'boo': None, 'foo': None},
 | 
					                           {'a': "--", 'boo': None, 'foo': None},
 | 
				
			||||||
                           ["foo", "bar"]),
 | 
					                           ["foo", "bar"])
 | 
				
			||||||
        self.assertParseOK(["-a", "--", "--foo", "bar"],
 | 
					        self.assertParseOK(["-a", "--", "--foo", "bar"],
 | 
				
			||||||
                           {'a': "--", 'boo': None, 'foo': ["bar"]},
 | 
					                           {'a': "--", 'boo': None, 'foo': ["bar"]},
 | 
				
			||||||
                           []),
 | 
					                           [])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_short_option_joined_and_separator(self):
 | 
					    def test_short_option_joined_and_separator(self):
 | 
				
			||||||
        self.assertParseOK(["-ab", "--", "--foo", "bar"],
 | 
					        self.assertParseOK(["-ab", "--", "--foo", "bar"],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue