Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-46198: rename duplicate tests and remove unused code #30297

Merged
merged 3 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Lib/test/datetimetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -1864,8 +1864,6 @@ def test_fromisoformat_fails(self):

def test_fromisoformat_fails_typeerror(self):
# Test that fromisoformat fails when passed the wrong type
import io

bad_types = [b'2009-03-01', None, io.StringIO('2009-03-01')]
for bad_type in bad_types:
with self.assertRaises(TypeError):
Expand Down Expand Up @@ -3988,8 +3986,6 @@ def test_fromisoformat_fails(self):

def test_fromisoformat_fails_typeerror(self):
# Test the fromisoformat fails when passed the wrong type
import io

bad_types = [b'12:30:45', None, io.StringIO('12:30:45')]

for bad_type in bad_types:
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,9 +1438,6 @@ def __init__(self, link=None):

self._platform_specific()

def _platform_specific(self):
pass

if sys.platform == "win32":
def _platform_specific(self):
import glob
Expand Down Expand Up @@ -1468,6 +1465,9 @@ def _platform_specific(self):
self._env["PYTHONHOME"] = os.path.dirname(self.real)
if sysconfig.is_python_build(True):
self._env["PYTHONPATH"] = STDLIB_DIR
else:
def _platform_specific(self):
pass

def __enter__(self):
os.symlink(self.real, self.link)
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_asyncio/test_sslproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import logging
import socket
from test import support
import unittest
import weakref
from unittest import mock
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def check(input, expect):
# On small versions of Windows like Windows IoT or Windows Nano Server not all codepages are present
def is_code_page_present(cp):
from ctypes import POINTER, WINFUNCTYPE, WinDLL
from ctypes.wintypes import BOOL, UINT, BYTE, WCHAR, UINT, DWORD
from ctypes.wintypes import BOOL, BYTE, WCHAR, UINT, DWORD

MAX_LEADBYTES = 12 # 5 ranges, 2 bytes ea., 0 term.
MAX_DEFAULTCHAR = 2 # single or double byte
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ def test_func_kwargs(self):
kwargs = (f'a{i}=x' for i in range(self.N))
self.check_stack_size("f(" + ", ".join(kwargs) + ")")

def test_func_args(self):
def test_meth_args(self):
self.check_stack_size("o.m(" + "x, " * self.N + ")")

def test_meth_kwargs(self):
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ def test_dict_items_result_gc(self):
self.assertTrue(gc.is_tracked(next(it)))

@support.cpython_only
def test_dict_items_result_gc(self):
def test_dict_items_result_gc_reversed(self):
# Same as test_dict_items_result_gc above, but reversed.
it = reversed({None: []}.items())
gc.collect()
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_email/test__header_value_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def test_get_unstructured_without_trailing_whitespace_hang_case(self):
[errors.InvalidHeaderDefect],
'')

def test_get_unstructured_invalid_ew(self):
def test_get_unstructured_invalid_ew2(self):
self._test_get_x(self._get_unst,
'=?utf-8?q?=somevalue?=',
'=?utf-8?q?=somevalue?=',
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3708,7 +3708,7 @@ class Sillier(IntEnum):
triple = 3
value = 4

class TestHelpers(unittest.TestCase):
class TestInternals(unittest.TestCase):

sunder_names = '_bad_', '_good_', '_what_ho_'
dunder_names = '__mal__', '__bien__', '__que_que__'
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_pty.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import unittest

import struct
import tty
import fcntl
import warnings

Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_tabnanny.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* errored : Whitespace related problems present in file.
"""
from unittest import TestCase, mock
from unittest import mock
import errno
import os
import tabnanny
Expand Down