petermr / amiclimate

software and material for managing climate knowledge
Apache License 2.0
0 stars 0 forks source link

test/test_un.py::TestUNFCCC::test_make_nested_divs - AssertionError #12

Open flower1430 opened 4 months ago

flower1430 commented 4 months ago
"C:\Program Files\Python39\python.exe" "C:/Program Files/JetBrains/PyCharm Community Edition 2023.2.5/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py" --target test_un.py::TestUNFCCC.test_make_nested_divs 
Testing started at 10:42 AM ...
Launching pytest with arguments test_un.py::TestUNFCCC::test_make_nested_divs --no-header --no-summary -q in C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\test

============================= test session starts =============================
collecting ... collected 1 item

test_un.py::TestUNFCCC::test_make_nested_divs 

============================== 1 failed in 4.82s ==============================
FAILED                     [100%]
test\test_un.py:1586 (TestUNFCCC.test_make_nested_divs)
self = <test.test_un.TestUNFCCC testMethod=test_make_nested_divs>

    def test_make_nested_divs(self):
        """IMPORTANT not finished"""
        """initial div files are 'flat' - all divs are siblings, Use parents in markup_dict to assemble
        """
        input_dir = Path(UNFCCC_DIR, "unfcccdocuments1", "CMA_3")
        infile = Path(input_dir, "1_4_CMA_3_section", f"normalized.sections.html")
>       assert str(infile).endswith(
            "test/resources/unfccc/unfcccdocuments1/CMA_3/1_4_CMA_3_section/normalized.sections.html")
E       AssertionError: assert False
E        +  where False = <built-in method endswith of str object at 0x00000192BAEB9630>('test/resources/unfccc/unfcccdocuments1/CMA_3/1_4_CMA_3_section/normalized.sections.html')
E        +    where <built-in method endswith of str object at 0x00000192BAEB9630> = 'C:\\Users\\ADMIN\\Desktop\\sc_pyami\\amiclimate\\test\\resources\\unfccc\\unfcccdocuments1\\CMA_3\\1_4_CMA_3_section\\normalized.sections.html'.endswith
E        +      where 'C:\\Users\\ADMIN\\Desktop\\sc_pyami\\amiclimate\\test\\resources\\unfccc\\unfcccdocuments1\\CMA_3\\1_4_CMA_3_section\\normalized.sections.html' = str(WindowsPath('C:/Users/ADMIN/Desktop/sc_pyami/amiclimate/test/resources/unfccc/unfcccdocuments1/CMA_3/1_4_CMA_3_section/normalized.sections.html'))

test_un.py:1593: AssertionError

Process finished with exit code 1
petermr commented 4 months ago

I think this is a bad test and should be rewritten to take care of OS differences (essentially / and \)

On Tue, May 14, 2024 at 6:12 AM flower1430 @.***> wrote:

"C:\Program Files\Python39\python.exe" "C:/Program Files/JetBrains/PyCharm Community Edition 2023.2.5/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py" --target test_un.py::TestUNFCCC.test_make_nested_divs Testing started at 10:42 AM ... Launching pytest with arguments test_un.py::TestUNFCCC::test_make_nested_divs --no-header --no-summary -q in C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\test

============================= test session starts ============================= collecting ... collected 1 item

test_un.py::TestUNFCCC::test_make_nested_divs

============================== 1 failed in 4.82s ============================== FAILED [100%] test\test_un.py:1586 (TestUNFCCC.test_make_nested_divs) self =

def test_make_nested_divs(self):
    """IMPORTANT not finished"""
    """initial div files are 'flat' - all divs are siblings, Use parents in markup_dict to assemble
    """
    input_dir = Path(UNFCCC_DIR, "unfcccdocuments1", "CMA_3")
    infile = Path(input_dir, "1_4_CMA_3_section", f"normalized.sections.html")
  assert str(infile).endswith(

"test/resources/unfccc/unfcccdocuments1/CMA_3/1_4_CMA_3_section/normalized.sections.html") E AssertionError: assert False E + where False = <built-in method endswith of str object at 0x00000192BAEB9630>('test/resources/unfccc/unfcccdocuments1/CMA_3/1_4_CMA_3_section/normalized.sections.html') E + where <built-in method endswith of str object at 0x00000192BAEB9630> = 'C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\test\resources\unfccc\unfcccdocuments1\CMA_3\1_4_CMA_3_section\normalized.sections.html'.endswith E + where 'C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\test\resources\unfccc\unfcccdocuments1\CMA_3\1_4_CMA_3_section\normalized.sections.html' = str(WindowsPath('C:/Users/ADMIN/Desktop/sc_pyami/amiclimate/test/resources/unfccc/unfcccdocuments1/CMA_3/1_4_CMA_3_section/normalized.sections.html'))

test_un.py:1593: AssertionError

Process finished with exit code 1

— Reply to this email directly, view it on GitHub https://github.com/petermr/amiclimate/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFTCS2NUFORE6VO6M2UEITZCGMNXAVCNFSM6AAAAABHVNWEN2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4TINBSGIYDSNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Peter Murray-Rust Founder ContentMine.org and Reader Emeritus in Molecular Informatics Dept. Of Chemistry, University of Cambridge, CB2 1EW, UK

xpriyanshux commented 4 months ago

getting the same error on windows 11 Python 3.10.11