petermr / amiclimate

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

test/test_un.py::TestIPCC::test_symbol_indir - AssertionError #10

Open flower1430 opened 6 months ago

flower1430 commented 6 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::TestIPCC.test_symbol_indir 
Testing started at 10:39 AM ...
Launching pytest with arguments test_un.py::TestIPCC::test_symbol_indir --no-header --no-summary -q in C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\test

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

test_un.py::TestIPCC::test_symbol_indir 

============================== 1 failed in 7.48s ==============================
FAILED                           [100%]command: ['IPCC', '--indir', '_IPCC_REPORTS', '--input', '_HTML_IDS', '--query', 'methane', '--outdir', '_QUERY_OUT', '--output', 'C:\\Users\\ADMIN\\Desktop\\sc_pyami\\amiclimate\\temp\\queries\\methane_norefs2.html', '--xpath', '_NOREFS']
arg_dict: {'version': False, 'command': 'IPCC', 'debug': False, 'input': '_HTML_IDS', 'indir': '_IPCC_REPORTS', 'output': 'C:\\Users\\ADMIN\\Desktop\\sc_pyami\\amiclimate\\temp\\queries\\methane_norefs2.html', 'outdir': '_QUERY_OUT', 'informat': 'PDF', 'query': 'methane', 'xpath': '_NOREFS'}
home C:\Users\ADMIN
outdir C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries output C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html
empty list from C:\/Users/ADMIN/Desktop/sc_pyami/amiclimate/temp/queries/C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html
inputs: 33 > [PurePosixPath('C:\\/Users/ADMIN/Desktop/sc_pyami/amiclimate/test/resources/ipcc/cleaned_content\\sr15\\Chapter01\\html_with_ids.html'), PurePosixPath('C:\\/Users/ADMIN/Desktop/sc_pyami/amiclimate/test/resources/ipcc/cleaned_content\\sr15\\Chapter02\\html_with_ids.html'), PurePosixPath('C:\\/Users/ADMIN/Desktop/sc_pyami/amiclimate/test/resources/ipcc/cleaned_content\\sr15\\Chapter03\\html_with_ids.html')]...
debug: True
report: None
chapter: None
outdir: C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries
output: C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html
kwargs: {}
query: ['methane']
xpath: //p[@id and not(ancestor::*[@id='references'])]
wrote: C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html
argstr: None

test\test_un.py:1041 (TestIPCC.test_symbol_indir)
60 != 57

Expected :57
Actual   :60
<Click to see difference>

self = <test.test_un.TestIPCC testMethod=test_symbol_indir>

    def test_symbol_indir(self):

        infile = "**/html_with_ids.html"
        outdir = f"{Path(Resources.TEMP_DIR, 'queries')}"
        output = f"{Path(outdir, 'methane_norefs2')}.html"
        query = "methane"

        AMIClimate().run_command(
            ['IPCC', '--indir', "_IPCC_REPORTS", '--input', "_HTML_IDS", '--query', "methane", '--outdir', "_QUERY_OUT",
             "--output", output, '--xpath',
             "_NOREFS"])
>       self.check_output_tree(output, expected=[60,300], xpath=".//a[@href]")

test_un.py:1053:

Process finished with exit code 1
petermr commented 6 months ago

I think this test is too strict and can be lessened

On Tue, May 14, 2024 at 6:10 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::TestIPCC.test_symbol_indir Testing started at 10:39 AM ... Launching pytest with arguments test_un.py::TestIPCC::test_symbol_indir --no-header --no-summary -q in C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\test

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

test_un.py::TestIPCC::test_symbol_indir

============================== 1 failed in 7.48s ============================== FAILED [100%]command: ['IPCC', '--indir', '_IPCC_REPORTS', '--input', '_HTML_IDS', '--query', 'methane', '--outdir', '_QUERY_OUT', '--output', 'C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html', '--xpath', '_NOREFS'] arg_dict: {'version': False, 'command': 'IPCC', 'debug': False, 'input': '_HTML_IDS', 'indir': '_IPCC_REPORTS', 'output': 'C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html', 'outdir': '_QUERY_OUT', 'informat': 'PDF', 'query': 'methane', 'xpath': '_NOREFS'} home C:\Users\ADMIN outdir C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries output C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html empty list from C:\/Users/ADMIN/Desktop/sc_pyami/amiclimate/temp/queries/C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html inputs: 33 > [PurePosixPath('C:\/Users/ADMIN/Desktop/sc_pyami/amiclimate/test/resources/ipcc/cleaned_content\sr15\Chapter01\html_with_ids.html'), PurePosixPath('C:\/Users/ADMIN/Desktop/sc_pyami/amiclimate/test/resources/ipcc/cleaned_content\sr15\Chapter02\html_with_ids.html'), PurePosixPath('C:\/Users/ADMIN/Desktop/sc_pyami/amiclimate/test/resources/ipcc/cleaned_content\sr15\Chapter03\html_with_ids.html')]... debug: True report: None chapter: None outdir: C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries output: C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html kwargs: {} query: ['methane'] xpath: @. and @.='references'])] wrote: C:\Users\ADMIN\Desktop\sc_pyami\amiclimate\temp\queries\methane_norefs2.html argstr: None

test\test_un.py:1041 (TestIPCC.test_symbol_indir) 60 != 57

Expected :57 Actual :60

self = def test_symbol_indir(self): infile = "**/html_with_ids.html" outdir = f"{Path(Resources.TEMP_DIR, 'queries')}" output = f"{Path(outdir, 'methane_norefs2')}.html" query = "methane" AMIClimate().run_command( ['IPCC', '--indir', "_IPCC_REPORTS", '--input', "_HTML_IDS", '--query', "methane", '--outdir', "_QUERY_OUT", "--output", output, '--xpath', "_NOREFS"]) > self.check_output_tree(output, expected=[60,300], ***@***.***") test_un.py:1053: Process finished with exit code 1 — Reply to this email directly, view it on GitHub , or unsubscribe . 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 6 months ago

getting the same error on windows 11 Python 3.10.11