Skip to content

Commit 7406f82

Browse files
committed
tests: fix up some deprecation warnings
1 parent b585dde commit 7406f82

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

mfr/extensions/tabular/libs/stdlib_tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ def _set_dialect_quote_attrs(dialect, data):
8383
'{"a", "b", "c" for quotechar == "
8484
"""
8585
if dialect.quotechar == '"':
86-
if re.search('\'[[({]".+",', data):
86+
if re.search('\'[([{]".+",', data):
8787
dialect.quotechar = "'"
88-
if re.search("'''[[({]\".+\",", data):
88+
if re.search("'''[([{]\".+\",", data):
8989
dialect.doublequote = True
9090
elif dialect.quotechar == "'":
91-
if re.search("\"[[({]'.+',", data):
91+
if re.search("\"[([{]'.+',", data):
9292
dialect.quotechar = '"'
93-
if re.search('"""[[({]\'.+\',', data):
93+
if re.search('"""[([{]\'.+\',', data):
9494
dialect.doublequote = True

tests/extensions/zip/test_renderer.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,24 @@ class TestZipRenderer:
6565

6666
def test_render(self, renderer):
6767
body = renderer.render()
68-
parsed_html = BeautifulSoup(body)
69-
rows = parsed_html.findChildren('table')[0].findChildren(['tr'])
68+
parsed_html = BeautifulSoup(body, 'html.parser')
69+
rows = parsed_html.find_all('table')[0].find_all(['tr'])
7070

71-
name = rows[2].findChildren('td')[0].get_text().strip()
71+
name = rows[2].find_all('td')[0].get_text().strip()
7272
assert 'test/test 1' == name
7373

74-
date_modified = rows[2].findChildren('td')[1].get_text().strip()
74+
date_modified = rows[2].find_all('td')[1].get_text().strip()
7575
assert '2017-03-02 16:22:14' == date_modified
7676

77-
size = rows[2].findChildren('td')[2].get_text().strip()
77+
size = rows[2].find_all('td')[2].get_text().strip()
7878
assert '15B' == size
7979

8080
# non-expanded zip file should have no children
81-
name = rows[4].findChildren('td')[0].get_text().strip()
81+
name = rows[4].find_all('td')[0].get_text().strip()
8282
assert 'test/zip file which is not expanded.zip' == name
8383
assert body.count('zip file which is not expanded.zip') == 1
8484

85-
size = rows[4].findChildren('td')[2].get_text().strip()
85+
size = rows[4].find_all('td')[2].get_text().strip()
8686
assert '1.8KB' == size # formatting of larger byte sizes
8787

8888
# hidden files should be hidden

0 commit comments

Comments
 (0)