From 0eeff79e4dad36232c943c47b4a692f2cf0652a3 Mon Sep 17 00:00:00 2001 From: Abel Cheung Date: Fri, 12 Apr 2024 15:16:36 +0000 Subject: [PATCH] chore: Remove html.souparser stub tests, already migrated to runtime tests --- test-stub/test-soupparser.yml | 67 ----------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 test-stub/test-soupparser.yml diff --git a/test-stub/test-soupparser.yml b/test-stub/test-soupparser.yml deleted file mode 100644 index 2d32939..0000000 --- a/test-stub/test-soupparser.yml +++ /dev/null @@ -1,67 +0,0 @@ -- case: fromstring - parametrized: - - args: content - - args: "data=fileio, beautifulsoup=BeautifulSoup" - - args: "content, BeautifulSoup, html_parser.makeelement" - - args: "fileio, makeelement=html_parser.makeelement" - main: | - from lxml.html.soupparser import fromstring - from bs4 import BeautifulSoup - from lxml.html import html_parser - content: str - fileio = open('file', 'r') - result = fromstring({{ args }}) - reveal_type(result) # NR: Revealed type is "[\w\.]+\.HtmlElement" - -- case: parse - parametrized: - - args: fileio - - args: "file=filename, beautifulsoup=BeautifulSoup" - - args: "fileio, BeautifulSoup, xhtml_parser.makeelement" - - args: "filename, makeelement=xhtml_parser.makeelement" - main: | - from lxml.html.soupparser import parse - from bs4 import BeautifulSoup - from lxml.html import xhtml_parser - fileio = open('file', 'r') - filename: str - result = parse({{ args }}) - reveal_type(result) # NR: Revealed type is "[\w\.]+\._ElementTree\[[\w\.]+\.HtmlElement]" - -- case: convert_tree - main: | - from lxml.html.soupparser import convert_tree - from bs4 import BeautifulSoup - parsed: BeautifulSoup - result = convert_tree(parsed) - reveal_type(result) # NR: Revealed type is "builtins\.list\[[\w\.]+\.HtmlElement]" - -- case: noarg - parametrized: - - func: fromstring - - func: parse - - func: convert_tree - main: | - from lxml.html import soupparser as sp - sp.{{ func }}() # ER: Missing positional argument .+ - -- case: badargs - expect_fail: true - parametrized: - - func: fromstring - args: 1 - - func: fromstring - args: fileio, _Element - - func: parse - args: 1 - - func: parse - args: fileio, _Element - - func: convert_tree - args: fileio - main: | - from lxml.html import soupparser as sp - from lxml.etree import _Element - from bs4 import BeautifulSoup - from io import StringIO - fileio: StringIO - sp.{{ func }}({{ args }})