mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
change some imports in tests so they will not be skipped in 3.0
This commit is contained in:
parent
913c15c1c6
commit
d21dabc890
2 changed files with 6 additions and 6 deletions
|
@ -1,17 +1,17 @@
|
||||||
"""Tests for HTMLParser.py."""
|
"""Tests for HTMLParser.py."""
|
||||||
|
|
||||||
import HTMLParser
|
import html.parser
|
||||||
import pprint
|
import pprint
|
||||||
import unittest
|
import unittest
|
||||||
from test import test_support
|
from test import test_support
|
||||||
|
|
||||||
|
|
||||||
class EventCollector(HTMLParser.HTMLParser):
|
class EventCollector(html.parser.HTMLParser):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.events = []
|
self.events = []
|
||||||
self.append = self.events.append
|
self.append = self.events.append
|
||||||
HTMLParser.HTMLParser.__init__(self)
|
html.parser.HTMLParser.__init__(self)
|
||||||
|
|
||||||
def get_events(self):
|
def get_events(self):
|
||||||
# Normalize the list of events so that buffer artefacts don't
|
# Normalize the list of events so that buffer artefacts don't
|
||||||
|
@ -88,10 +88,10 @@ class TestCaseBase(unittest.TestCase):
|
||||||
|
|
||||||
def _parse_error(self, source):
|
def _parse_error(self, source):
|
||||||
def parse(source=source):
|
def parse(source=source):
|
||||||
parser = HTMLParser.HTMLParser()
|
parser = html.parser.HTMLParser()
|
||||||
parser.feed(source)
|
parser.feed(source)
|
||||||
parser.close()
|
parser.close()
|
||||||
self.assertRaises(HTMLParser.HTMLParseError, parse)
|
self.assertRaises(html.parser.HTMLParseError, parse)
|
||||||
|
|
||||||
|
|
||||||
class HTMLParserTestCase(TestCaseBase):
|
class HTMLParserTestCase(TestCaseBase):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import unittest
|
import unittest
|
||||||
import os
|
import os
|
||||||
from test import test_support
|
from test import test_support
|
||||||
from Tkinter import Tcl
|
from tkinter import Tcl
|
||||||
from _tkinter import TclError
|
from _tkinter import TclError
|
||||||
|
|
||||||
class TclTest(unittest.TestCase):
|
class TclTest(unittest.TestCase):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue