Extend code coverage across sphinx-runpython utilities#60
Conversation
Agent-Logs-Url: https://github.com/sdpython/sphinx-runpython/sessions/5f7ddf50-ca98-4180-bfc7-e949b3b79b24 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Agent-Logs-Url: https://github.com/sdpython/sphinx-runpython/sessions/5f7ddf50-ca98-4180-bfc7-e949b3b79b24 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
…_helper, process_rst, readme Agent-Logs-Url: https://github.com/sdpython/sphinx-runpython/sessions/5f7ddf50-ca98-4180-bfc7-e949b3b79b24 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
…ther Agent-Logs-Url: https://github.com/sdpython/sphinx-runpython/sessions/5f7ddf50-ca98-4180-bfc7-e949b3b79b24 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
|
@copilot merge with main branch |
…overage Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Done — merged |
|
@copilot bypss _unittests/ut__main/test_cmd.py::TestCmd::test_process_args_readme on windows |
|
@copilot ignore _unittests/ut__main/test_cmd.py::TestCmd::test_process_args_readme on windows |
Agent-Logs-Url: https://github.com/sdpython/sphinx-runpython/sessions/6bff9a98-f076-48c0-b958-a41e73f5b704 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Done — added
Done — |
|
@copilot FAILED _unittests/ut__main/test_github_link.py::TestGithubLink::test_linkcode_resolve_function - ValueError: path is on mount 'D:', start on mount 'C:' |
Agent-Logs-Url: https://github.com/sdpython/sphinx-runpython/sessions/673d9b92-6119-4171-8dc5-2c28bc233e20 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Fixed in commit
|
Agent-Logs-Url: https://github.com/sdpython/sphinx-runpython/sessions/15edfe84-fbd3-4ec9-a96d-dd20182e8f72 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Code coverage was insufficient across several core modules. This PR adds tests to significantly improve coverage, with several modules reaching 100%.
Coverage improvements
_cmd_helper.pylanguage.pyconf_helper.pytools/latex_functions.pyprocess_rst.pytools/img_export.pyext_test_case.pyimport_object_helper.pygithub_link.pyrunpython/run_cmd.pyTotal passing tests: 89 → 229
New test files
test_github_link.py—_linkcode_resolve,make_linkcode_resolve, import errorstest_language.py—TITLES,sphinx_langwith fake env objectstest_ext_helper.py—TinyNode,NodeEnter/Leave,traverse,WrappedNodetest_ext_io_helper.py—_get_file_url, exception classes,get_url_content_timeouttest_import_object_helper.py—import_objectfor all kinds (function/class/method/property/staticmethod),import_path, error pathstest_process_rst.py— docutils (use_sphinx=False) mode, invalidwriterkwargtest_readme_helpers.py—VirtualEnvError,build_venv_cmd,is_virtual_environmenttest_ext_test_case.py— allExtTestCaseassertion helpers,hide_stdout,sys_path_append, platform guardsExtended existing tests
test_cmd.py— in-place latex processing,process_argsfor all commands (nb2py,api,latex,img2pdf,readme),main()entry pointtest_helpers.py— mocked_check_cmdto cover both return paths without requiringdvipng/dvisvgminstalledtest_run_cmd.py—get_interpreter_path,split_cmp_command,decode_outerr(including Unicode fallback and error paths),run_cmdwithlogf,change_path,catch_exit,prefix_log,wait=Falsetest_imgexport.py— single-file string input, glob string input, stream output, rotate+zoom with verbose, invalid inputstest_latex_functions.py— callable pattern, invalid regex pattern, unknown value typeWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdnjs.cloudflare.com/usr/bin/python /usr/bin/python -m sphinx -b rst /tmp/tmp45hzxrzf /tmp/tmp45hzxrzf/output /usr/local/bin/uname(dns block)/usr/bin/python /usr/bin/python -m sphinx -b rst /tmp/tmp7etbiibi /tmp/tmp7etbiibi/output /usr/sbin/uname(dns block)/usr/bin/python /usr/bin/python -m sphinx -b rst /tmp/tmphb4bjza6 /tmp/tmphb4bjza6/output /usr/bin/uname(dns block)requirejs.org/usr/bin/python /usr/bin/python -m sphinx -b rst /tmp/tmp45hzxrzf /tmp/tmp45hzxrzf/output /usr/local/bin/uname(dns block)/usr/bin/python /usr/bin/python -m sphinx -b rst /tmp/tmp7etbiibi /tmp/tmp7etbiibi/output /usr/sbin/uname(dns block)/usr/bin/python /usr/bin/python -m sphinx -b rst /tmp/tmphb4bjza6 /tmp/tmphb4bjza6/output /usr/bin/uname(dns block)If you need me to access, download, or install something from one of these locations, you can either: