commit:     7b7dbac9bd5ed1e8be910661393d655619680070
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 22 01:21:28 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 22 01:28:54 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b7dbac9

dev-python/agate-excel: Enable unit tests (bug 797379)

tests/test_table_xls.py::TestXLS::test_ambiguous_date PASSED                    
                                                                                
                       [  4%]
tests/test_table_xls.py::TestXLS::test_empty PASSED                             
                                                                                
                       [  8%]
tests/test_table_xls.py::TestXLS::test_file_like PASSED                         
                                                                                
                       [ 13%]
tests/test_table_xls.py::TestXLS::test_from_xls PASSED                          
                                                                                
                       [ 17%]
tests/test_table_xls.py::TestXLS::test_from_xls_with_column_names PASSED        
                                                                                
                       [ 21%]
tests/test_table_xls.py::TestXLS::test_header PASSED                            
                                                                                
                       [ 26%]
tests/test_table_xls.py::TestXLS::test_numeric_column_name PASSED               
                                                                                
                       [ 30%]
tests/test_table_xls.py::TestXLS::test_sheet_index PASSED                       
                                                                                
                       [ 34%]
tests/test_table_xls.py::TestXLS::test_sheet_multiple PASSED                    
                                                                                
                       [ 39%]
tests/test_table_xls.py::TestXLS::test_sheet_name PASSED                        
                                                                                
                       [ 43%]
tests/test_table_xls.py::TestXLS::test_skip_lines PASSED                        
                                                                                
                       [ 47%]
tests/test_table_xls.py::TestXLS::test_zeros PASSED                             
                                                                                
                       [ 52%]
tests/test_table_xlsx.py::TestXLSX::test_ambiguous_date FAILED                  
                                                                                
                       [ 56%]
tests/test_table_xlsx.py::TestXLSX::test_empty PASSED                           
                                                                                
                       [ 60%]
tests/test_table_xlsx.py::TestXLSX::test_file_like PASSED                       
                                                                                
                       [ 65%]
tests/test_table_xlsx.py::TestXLSX::test_from_xlsx PASSED                       
                                                                                
                       [ 69%]
tests/test_table_xlsx.py::TestXLSX::test_from_xlsx_with_column_names PASSED     
                                                                                
                       [ 73%]
tests/test_table_xlsx.py::TestXLSX::test_header PASSED                          
                                                                                
                       [ 78%]
tests/test_table_xlsx.py::TestXLSX::test_numeric_column_name PASSED             
                                                                                
                       [ 82%]
tests/test_table_xlsx.py::TestXLSX::test_sheet_index PASSED                     
                                                                                
                       [ 86%]
tests/test_table_xlsx.py::TestXLSX::test_sheet_multiple PASSED                  
                                                                                
                       [ 91%]
tests/test_table_xlsx.py::TestXLSX::test_sheet_name PASSED                      
                                                                                
                       [ 95%]
tests/test_table_xlsx.py::TestXLSX::test_skip_lines PASSED                      
                                                                                
                       [100%]

Reported-py: Michał Górny <mgorny <AT> gentoo.org>
Closes: https://bugs.gentoo.org/797379
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 dev-python/agate-excel/agate-excel-0.2.3.ebuild | 27 +++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/dev-python/agate-excel/agate-excel-0.2.3.ebuild 
b/dev-python/agate-excel/agate-excel-0.2.3.ebuild
index 224da100426..0774e1cfcad 100644
--- a/dev-python/agate-excel/agate-excel-0.2.3.ebuild
+++ b/dev-python/agate-excel/agate-excel-0.2.3.ebuild
@@ -15,10 +15,33 @@ SLOT="0"
 KEYWORDS="~amd64"
 IUSE=""
 RDEPEND=""
-RESTRICT="test"
+IUSE="test +xml"
+RESTRICT="!test? ( test )"
 
+# Other packages have BDEPEND="test? ( dev-python/agate-excel[xml] )"
+AGATE_VERSION_DEP=">=dev-python/agate-1.5.0"
+TEST_AGAINST_RDEPEND="xml? ( ${AGATE_VERSION_DEP}[xml,${PYTHON_USEDEP}] )"
 RDEPEND="
-       >=dev-python/agate-1.5.0[${PYTHON_USEDEP}]
+       ${AGATE_VERSION_DEP}[${PYTHON_USEDEP}]
        >=dev-python/openpyxl-2.3.0[${PYTHON_USEDEP}]
        >=dev-python/xlrd-0.9.4[${PYTHON_USEDEP}]
+
+       ${TEST_AGAINST_RDEPEND}
 "
+BDEPEND="test? ( ${AGATE_VERSION_DEP}[xml,${PYTHON_USEDEP}] )"
+
+distutils_enable_tests pytest
+
+python_test() {
+       local pytest_args test_name xfails
+
+       xfails=(
+               tests/test_table_xlsx.py::TestXLSX::test_ambiguous_date
+       )
+
+       for test_name in "${xfails[@]}"; do
+               pytest_args+=(--deselect "${test_name}")
+       done
+
+       epytest "${pytest_args[@]}" || die
+}

Reply via email to