Bug#1056432: openpyxl's autopkg tests fail with Python 3.12

Matthias Klose doko at debian.org
Wed Nov 22 12:18:57 GMT 2023


Package: src:openpyxl
Version: 3.1.2+dfsg-2
Severity: important
Tags: sid trixie
User: debian-python at lists.debian.org
Usertags: python3.12

openpyxl's autopkg tests fail with Python 3.12:

[...]
265s =================================== FAILURES 
===================================
265s ___________________ TestWorkbookParser.test_broken_sheet_ref 
___________________
265s
265s self = <openpyxl.reader.tests.test_workbook.TestWorkbookParser 
object at 0x7fa349e08230>
265s datadir = 
local('/tmp/autopkgtest.cmsRIc/autopkgtest_tmp/openpyxl/reader/tests/data')
265s recwarn = WarningsRecorder(record=True)
265s WorkbookParser = <class 'openpyxl.reader.workbook.WorkbookParser'>
265s
265s     def test_broken_sheet_ref(self, datadir, recwarn, WorkbookParser):
265s         from openpyxl.packaging.workbook import WorkbookPackage
265s         datadir.chdir()
265s         with open("workbook_missing_id.xml", "rb") as src:
265s             xml = src.read()
265s             node = fromstring(xml)
265s         wb = WorkbookPackage.from_tree(node)
265s
265s         archive = ZipFile(BytesIO(), "a")
265s         archive.write("workbook_links.xml", ARC_WORKBOOK)
265s         archive.writestr(ARC_WORKBOOK_RELS, b"<root />")
265s
265s         parser = WorkbookParser(archive, ARC_WORKBOOK)
265s         parser.sheets = wb.sheets
265s         sheets = parser.find_sheets()
265s         list(sheets)
265s         w = recwarn.pop()
265s >       assert issubclass(w.category, UserWarning)
265s E       AssertionError: assert False
265s E        +  where False = issubclass(<class 'DeprecationWarning'>, 
UserWarning)
265s E        +    where <class 'DeprecationWarning'> = 
<warnings.WarningMessage object at 0x7fa3474155e0>.category
265s
265s 
/tmp/autopkgtest.cmsRIc/autopkgtest_tmp/openpyxl/reader/tests/test_workbook.py:93: 
AssertionError
265s __________________ TestWorkbookParser.test_name_invalid_index 
__________________
265s
265s self = <openpyxl.reader.tests.test_workbook.TestWorkbookParser 
object at 0x7fa349e0b4d0>
265s datadir = 
local('/tmp/autopkgtest.cmsRIc/autopkgtest_tmp/openpyxl/reader/tests/data')
265s WorkbookParser = <class 'openpyxl.reader.workbook.WorkbookParser'>
265s recwarn = WarningsRecorder(record=True)
265s
265s     def test_name_invalid_index(self, datadir, WorkbookParser, 
recwarn):
265s         datadir.chdir()
265s         archive = ZipFile("print_settings.xlsx")
265s         parser = WorkbookParser(archive, ARC_WORKBOOK)
265s         parser.parse()
265s
265s         wb = parser.wb
265s         parser.defined_names.definedName = 
[DefinedName(name="_xlnm.Print_Area", localSheetId="19", attr_text="'New 
Monthly Metals'!$B$1:$O$15")]
265s         parser.assign_names()
265s
265s >       assert recwarn.pop().category == UserWarning
265s E       AssertionError: assert <class 'DeprecationWarning'> == 
UserWarning
265s E        +  where <class 'DeprecationWarning'> = 
<warnings.WarningMessage object at 0x7fa3474118b0>.category
265s E        +    where <warnings.WarningMessage object at 
0x7fa3474118b0> = <bound method WarningsRecorder.pop of 
WarningsRecorder(record=True)>()
265s E        +      where <bound method WarningsRecorder.pop of 
WarningsRecorder(record=True)> = WarningsRecorder(record=True).pop
265s
265s 
/tmp/autopkgtest.cmsRIc/autopkgtest_tmp/openpyxl/reader/tests/test_workbook.py:151: 
AssertionError
265s _______________ TestWorkbookParser.test_defined_names_print_area 
_______________
265s
265s self = <openpyxl.reader.tests.test_workbook.TestWorkbookParser 
object at 0x7fa349edc200>
265s datadir = 
local('/tmp/autopkgtest.cmsRIc/autopkgtest_tmp/openpyxl/reader/tests/data')
265s WorkbookParser = <class 'openpyxl.reader.workbook.WorkbookParser'>
265s recwarn = WarningsRecorder(record=True)
265s
265s     def test_defined_names_print_area(self, datadir, 
WorkbookParser, recwarn):
265s         datadir.chdir()
265s         archive = ZipFile("print_area_table_defined_name.xlsx")
265s
265s         parser = WorkbookParser(archive, ARC_WORKBOOK)
265s         parser.parse()
265s         parser.assign_names()
265s
265s >       assert recwarn.pop().category == UserWarning
265s E       AssertionError: assert <class 'DeprecationWarning'> == 
UserWarning
265s E        +  where <class 'DeprecationWarning'> = 
<warnings.WarningMessage object at 0x7fa347413fe0>.category
265s E        +    where <warnings.WarningMessage object at 
0x7fa347413fe0> = <bound method WarningsRecorder.pop of 
WarningsRecorder(record=True)>()
265s E        +      where <bound method WarningsRecorder.pop of 
WarningsRecorder(record=True)> = WarningsRecorder(record=True).pop
265s
265s 
/tmp/autopkgtest.cmsRIc/autopkgtest_tmp/openpyxl/reader/tests/test_workbook.py:195: 
AssertionError
265s ________________________________ test_no_styles 
________________________________
265s
265s recwarn = WarningsRecorder(record=True)
265s
265s     def test_no_styles(recwarn):
265s         from ..stylesheet import apply_stylesheet
265s         wb = Workbook()
265s         archive = ZipFile(BytesIO(), "a")
265s         xml = b"""<styleSheet 
xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" />"""
265s         archive.writestr("xl/styles.xml", xml)
265s         apply_stylesheet(archive, wb)
265s         w = recwarn.pop()
265s
265s >       assert w.category == UserWarning
265s E       AssertionError: assert <class 'DeprecationWarning'> == 
UserWarning
265s E        +  where <class 'DeprecationWarning'> = 
<warnings.WarningMessage object at 0x7fa3475df9b0>.category
265s
265s 
/tmp/autopkgtest.cmsRIc/autopkgtest_tmp/openpyxl/styles/tests/test_stylesheet.py:267: 
AssertionError



More information about the debian-science-maintainers mailing list