Skip to content

Test Failure with xlrd and defusedxml #27016

Closed
@simonjayhawkins

Description

@simonjayhawkins
================================== FAILURES ===================================
__________________ TestReaders.test_usecols_int[xlrd-.xlsx] ___________________

self = <pandas.tests.io.excel.test_readers.TestReaders object at 0x00000268B4801B70>
read_ext = '.xlsx'
df_ref =                    A         B         C
index
2000-01-03  0.980269  3.685731 -0.36...0-01-07 -0.487094  0.571455 -1.611639
2000-01-10  0.836649  0.246462  0.588543
2000-01-11 -0.157161  1.340307  1.195778

    def test_usecols_int(self, read_ext, df_ref):
        df_ref = df_ref.reindex(columns=["A", "B", "C"])

        # usecols as int
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False):
            with ignore_xlrd_time_clock_warning():
                df1 = pd.read_excel("test1" + read_ext, "Sheet1",
>                                   index_col=0, usecols=3)

..\excel\test_readers.py:60:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x00000268B549AFD0>
type = None, value = None, traceback = None

    def __exit__(self, type, value, traceback):
        if type is None:
            try:
>               next(self.gen)
E               AssertionError: Caused unexpected warning(s): [('PendingDeprecationWarning', PendingDeprecationWarning("This method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead."), 'C:\\Users\\simon\\Anaconda3\\envs\\pandas-dev\\lib\\site-packages\\xlrd\\xlsx.py', 266), ('PendingDeprecationWarning', PendingDeprecationWarning("This method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead."), 'C:\\Users\\simon\\Anaconda3\\envs\\pandas-dev\\lib\\site-packages\\xlrd\\xlsx.py', 312), ('PendingDeprecationWarning', PendingDeprecationWarning("This method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead."), 'C:\\Users\\simon\\Anaconda3\\envs\\pandas-dev\\lib\\site-packages\\xlrd\\xlsx.py', 266)].

C:\Users\simon\Anaconda3\envs\pandas-dev\lib\contextlib.py:119: AssertionError

INSTALLED VERSIONS
------------------
commit           : cf74b0272af2e13e5b9ce40c8bf42df750ddc560
python           : 3.7.3.final.0
python-bits      : 64
OS               : Windows
OS-release       : 10
machine          : AMD64
processor        : Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
byteorder        : little
LC_ALL           : None
LANG             : en_GB.UTF-8
LOCALE           : None.None

pandas           : 0.25.0.dev0+786.gcf74b0272
numpy            : 1.16.4
pytz             : 2019.1
dateutil         : 2.8.0
pip              : 19.1.1
setuptools       : 40.6.3
Cython           : 0.29.10
pytest           : 4.6.2
hypothesis       : 4.23.6
sphinx           : 1.8.5
blosc            : None
feather          : 0.4.0
xlsxwriter       : 1.1.8
lxml.etree       : 4.3.3
html5lib         : 1.0.1
pymysql          : 0.9.3
psycopg2         : None
jinja2           : 2.10.1
IPython          : 7.5.0
pandas_datareader: None
bs4              : 4.7.1
bottleneck       : 1.2.1
fastparquet      : 0.3.0
gcsfs            : None
matplotlib       : 3.1.0
numexpr          : 2.6.9
openpyxl         : 2.6.2
pandas_gbq       : None
pyarrow          : 0.11.1
pytables         : None
s3fs             : 0.2.1
scipy            : 1.2.1
sqlalchemy       : 1.3.4
tables           : 3.5.2
xarray           : 0.12.1
xlrd             : 1.2.0
xlwt             : 1.3.0
xlsxwriter       : 1.1.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    DependenciesRequired and optional dependenciesIO Excelread_excel, to_excelTestingpandas testing functions or related to the test suiteUnreliable TestUnit tests that occasionally fail

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions