Closed Smritiabcd closed 18 hours ago
I MAY have fixed this. I can't test it as it doesn't fail for me. BUT html_args behaves strangely. I have added try
to the imports in amix.py
try:
from html_args import HTMLArgs
except ModuleNotFoundError as e:
from amilib.html_args import HTMLArgs
from amilib.pdf_args import PDFArgs
I have committed new source code. Please git pull
and rerun pytest
Some of this may be down to relative-versus-absolute import. I have committed the latest main
branch and also created a relative
branch in case we need to explore that.
Tried running the test and still having the same issues
''' =============================================== short test summary info =============================================== FAILED test_pdf.py::PDFMainArgTest::test_cannot_iterate - argparse.ArgumentError: argument command: conflicting subparser: HTML FAILED test_pdf.py::PDFMainArgTest::test_pdf_help - argparse.ArgumentError: argument command: conflicting subparser: HTML FAILED test_pdf.py::PDFMainArgTest::test_pdf_html_ipcc_command_help - argparse.ArgumentError: argument command: conflicting subparser: HTML FAILED test_pdf.py::PDFMainArgTest::test_subcommands - argparse.ArgumentError: argument command: conflicting subparser: HTML FAILED test_pdf.py::PDFMainArgTest::test_subcommands_1 - argparse.ArgumentError: argument command: conflicting subparser: HTML
Windows 11, Python 3.12 '''
C:\Users\asus\Desktop\Semantic\amilib\test> pytest test_pdf.py::PDFMainArgTest::test_cannot_iterate ======================================================= test session starts ======================================================== platform win32 -- Python 3.12.3, pytest-8.2.0, pluggy-1.5.0 rootdir: C:\Users\asus\Desktop\Semantic\amilib collected 1 item
test_pdf.py F [100%]
============================================================= FAILURES ============================================================= ____ PDFMainArgTest.test_cannot_iterate ____
self =
test_pdf.py:1814:
..\amilib\amix.py:155: in run_command self.parse_and_run_args(args) ..\amilib\amix.py:169: in parse_and_run_args parser = self.create_arg_parser() ..\amilib\amix.py:95: in create_arg_parser amilib_parser = AmiLibArgs().make_sub_parser(subparsers) ..\amilib\util.py:829: in make_sub_parser self.parser = subparsers.add_parser(self.subparser_arg)
self = _SubParsersAction(option_strings=[], dest='command', nargs='A...', const=None, default=None, type=None, choices={'HTML...escriptionHelpFormatter'>, conflict_handler='error', add_help=True)}, required=False, help='subcommands', metavar=None) name = 'HTML', kwargs = {'prog': 'pytest HTML'}, aliases = ()
......\Internship\Lib\argparse.py:1219: ArgumentError ------------------------------------------------------- Captured stdout call ------------------------------------------------------- command: ['HTML'] ===================================================== short test summary info ====================================================== FAILED test_pdf.py::PDFMainArgTest::test_cannot_iterate - argparse.ArgumentError: argument command: conflicting subparser: HTML ======================================================== 1 failed in 9.94s =========================================================