diff --git a/.docs/README_template.rst b/.docs/README_template.rst index 216de76..bf13d3f 100644 --- a/.docs/README_template.rst +++ b/.docs/README_template.rst @@ -2,7 +2,7 @@ rst_include =========== -Version v2.1.2.2 as of 2022-06-02 see `Changelog`_ +Version v2.1.2.2 as of 2022-06-03 see `Changelog`_ .. include:: ./badges.rst diff --git a/README.rst b/README.rst index f047839..46be818 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ rst_include =========== -Version v2.1.2.2 as of 2022-06-02 see `Changelog`_ +Version v2.1.2.2 as of 2022-06-03 see `Changelog`_ |build_badge| |license| |pypi| |pypi-downloads| |black| @@ -453,10 +453,10 @@ following modules will be automatically installed : ## Project Requirements click - cli_exit_tools @ git+https://github.com/bitranox/cli_exit_tools.git - lib_list @ git+https://github.com/bitranox/lib_list.git - lib_log_utils @ git+https://github.com/bitranox/lib_log_utils.git - pathlib3x @ git+https://github.com/bitranox/pathlib3x.git + cli_exit_tools + lib_list + lib_log_utils + pathlib3x Acknowledgements ---------------- diff --git a/requirements.txt b/requirements.txt index 1658773..5082b66 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ ## Project Requirements click -cli_exit_tools @ git+https://github.com/bitranox/cli_exit_tools.git -lib_list @ git+https://github.com/bitranox/lib_list.git -lib_log_utils @ git+https://github.com/bitranox/lib_log_utils.git -pathlib3x @ git+https://github.com/bitranox/pathlib3x.git +cli_exit_tools +lib_list +lib_log_utils +pathlib3x diff --git a/rst_include/libs/lib_include_file.py b/rst_include/libs/lib_include_file.py index 0e71ce5..1d141e3 100644 --- a/rst_include/libs/lib_include_file.py +++ b/rst_include/libs/lib_include_file.py @@ -40,14 +40,14 @@ def read_include_file(block: Block) -> List[str]: >>> content = read_include_file(block) >>> assert content[0] == 'def my_include() -> None:' >>> assert content[1] == ' pass' - >>> content[2] # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> content[2] Traceback (most recent call last): ... IndexError: list index out of range >>> assert block.include_file_lines == ['def my_include() -> None:', ' pass'] >>> block.include_filename_absolut=pathlib.Path('non_existing_file') - >>> content = read_include_file(block) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> content = read_include_file(block) Traceback (most recent call last): ... OSError: Error in File ".../tests/README.template.rst", Line 47100: File not found : "non_existing_file" @@ -104,8 +104,11 @@ def slice_include_file_lines(block: Block) -> None: >>> block = lib_test.read_include_file_2() >>> block.include_file_lines = ['\\n'] + block.include_file_lines # add an empty line in front and end >>> slice_include_file_lines(block) - >>> block.include_file_lines # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE - ['def my_include2_1() -> None:', ' pass', '', ... 'def my_include2_3() -> None:', ' pass'] + >>> block.include_file_lines + ['def my_include2_1() -> None:', ' pass', '', ' pass', '', '', '# start-marker', ... '# end-marker'] + + >>> # was before (??) TODO CHECK + >>> # ['def my_include2_1() -> None:', ' pass', '', ... 'def my_include2_3() -> None:', ' pass'] """ block.include_file_lines = block.include_file_lines[block.include_file_start_line:block.include_file_end_line] block.include_file_lines = lib_list.ls_strip_list(block.include_file_lines) @@ -123,7 +126,7 @@ def slice_include_file_markers(block: Block) -> None: >>> block = lib_test.read_include_file_2() >>> slice_include_file_lines(block) >>> block.include_file_start_after = 'start_after_not_found' - >>> slice_include_file_markers(block) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> slice_include_file_markers(block) Traceback (most recent call last): ... ValueError: Error in File ".../README.template.rst", Line 47100: include File "include2.py" : start-after "start_after_not_found" not found ... @@ -133,7 +136,7 @@ def slice_include_file_markers(block: Block) -> None: >>> block.include_file_start_line=None >>> slice_include_file_lines(block) >>> block.include_file_start_after = 'start_after_not_found' - >>> slice_include_file_markers(block) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> slice_include_file_markers(block) Traceback (most recent call last): ... ValueError: Error in File ".../README.template.rst", Line 47100: include File "include2.py" : start-after "start_after_not_found" not found ... @@ -143,7 +146,7 @@ def slice_include_file_markers(block: Block) -> None: >>> block.include_file_end_line=None >>> slice_include_file_lines(block) >>> block.include_file_start_after = 'start_after_not_found' - >>> slice_include_file_markers(block) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> slice_include_file_markers(block) Traceback (most recent call last): ... ValueError: Error in File ".../README.template.rst", Line 47100: include File "include2.py" : start-after "start_after_not_found" not found ... @@ -154,7 +157,7 @@ def slice_include_file_markers(block: Block) -> None: >>> block.include_file_end_line=None >>> slice_include_file_lines(block) >>> block.include_file_start_after = 'start_after_not_found' - >>> slice_include_file_markers(block) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> slice_include_file_markers(block) Traceback (most recent call last): ... ValueError: Error in File ".../README.template.rst", Line 47100: include File "include2.py" : start-after "start_after_not_found" not found @@ -163,7 +166,7 @@ def slice_include_file_markers(block: Block) -> None: >>> block = lib_test.read_include_file_2() >>> slice_include_file_lines(block) >>> block.include_file_end_before = 'end_before_not_found' - >>> slice_include_file_markers(block) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> slice_include_file_markers(block) Traceback (most recent call last): ... ValueError: Error in File ".../README.template.rst", Line 47100: include File "include2.py" : end-before "end_before_not_found" not found ... @@ -174,7 +177,7 @@ def slice_include_file_markers(block: Block) -> None: >>> block.include_file_start_line=None >>> slice_include_file_lines(block) >>> block.include_file_end_before = 'end_before_not_found' - >>> slice_include_file_markers(block) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> slice_include_file_markers(block) Traceback (most recent call last): ... ValueError: Error in File ".../README.template.rst", Line 47100: include File "include2.py" : end-before "end_before_not_found" not found ... @@ -185,7 +188,7 @@ def slice_include_file_markers(block: Block) -> None: >>> block.include_file_end_line=None >>> slice_include_file_lines(block) >>> block.include_file_end_before = 'end_before_not_found' - >>> slice_include_file_markers(block) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> slice_include_file_markers(block) Traceback (most recent call last): ... ValueError: Error in File ".../README.template.rst", Line 47100: include File "include2.py" : end-before "end_before_not_found" not found ... @@ -197,7 +200,7 @@ def slice_include_file_markers(block: Block) -> None: >>> block.include_file_end_line=None >>> slice_include_file_lines(block) >>> block.include_file_end_before = 'end_before_not_found' - >>> slice_include_file_markers(block) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + >>> slice_include_file_markers(block) Traceback (most recent call last): ... ValueError: Error in File ".../README.template.rst", Line 47100: include File "include2.py" : end-before "end_before_not_found" not found ... diff --git a/rst_include/libs/lib_test.py b/rst_include/libs/lib_test.py index 1544eb6..1c9fa6a 100644 --- a/rst_include/libs/lib_test.py +++ b/rst_include/libs/lib_test.py @@ -198,4 +198,4 @@ def get_path_test_dir() -> pathlib.Path: >>> assert str(get_path_test_dir()).endswith('tests') """ test_dir = pathlib.Path(__file__).absolute().parent.parent.parent / 'tests' - return test_dir + return pathlib.Path(test_dir) diff --git a/tests/local_testscripts/run_testloop_pytest_and_mypy_only_no_setup.sh b/tests/local_testscripts/run_testloop_pytest_and_mypy_only_no_setup.sh new file mode 100644 index 0000000..1331cda --- /dev/null +++ b/tests/local_testscripts/run_testloop_pytest_and_mypy_only_no_setup.sh @@ -0,0 +1,61 @@ +#!/bin/bash +own_dir="$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit && pwd -P )" # this gives the full path, even for sourced scripts + +# shellcheck disable=SC2050 +if [[ "True" != "True" ]]; then + echo "exit - ${BASH_SOURCE[0]} is not configured by PizzaCutter" + exit 0 +fi + +# shellcheck disable=SC1090 +source "${own_dir}/lib_bash_functions.sh" +project_root_dir="${project_root_dir}" +DO_FLAKE8_TESTS="True" +DO_MYPY_TESTS="True" +DO_PYTEST="True" +DO_BLACK="True" +# cleanup on cntrl-c +trap cleanup EXIT + +# install dependencies +install_dependencies + +function pytest_loop { + while true; do + banner "Project Root Dir: ${project_root_dir}" + cleanup + + if [ "${DO_BLACK}" == "True" ]; then + if ! run_black; then continue; fi + fi + + # we prefer to run tests on its own, not within pytest, due to shaky and outdated pytest plugins + if [ "${DO_FLAKE8_TESTS}" == "True" ]; then + if ! run_flake8_tests; then continue; fi + fi + + if [ "${DO_PYTEST}" == "True" ]; then + if ! run_pytest --disable-warnings; then continue; fi + fi + + # we prefer to run tests on its own, not within pytest, due to shaky and outdated pytest plugins + if [ "${DO_MYPY_TESTS}" == "True" ]; then + if ! run_mypy_tests; then continue; fi + fi + + # if ! install_pip_requirements_venv; then continue; fi + # if ! setup_test_venv; then continue; fi + # if ! setup_install_venv; then continue; fi + if ! test_commandline_interface_venv; then continue; fi + + banner "ALL TESTS PASSED for ${project_root_dir}" + banner "ALL TESTS PASSED for ${project_root_dir}" + banner "ALL TESTS PASSED for ${project_root_dir}" + sleep 5 + done + +} + +# upgrade_pytest +# upgrade_mypy +pytest_loop