diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index b7242f4..f615c11 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -8,26 +8,28 @@ jobs: name: Run pylint runs-on: ubuntu-20.04 steps: + - uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v3 with: - python-version: 3.10 + python-version: "3.10" - name: Install dependencies run: pip install tox tox-gh-actions - name: "Run lint" run: tox -e lint type: - name: Run pylint + name: Run mypy runs-on: ubuntu-20.04 steps: + - uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v3 with: - python-version: 3.10 + python-version: "3.10" - name: Install dependencies run: pip install tox tox-gh-actions - name: "Run mypy" - run: tox -e mypy + run: tox -e type tox: name: Run pytest for supported Python versions runs-on: ubuntu-20.04 diff --git a/tests/test_cli.py b/tests/test_cli.py index 17180a4..5c6a4fe 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -410,9 +410,10 @@ def test_run_stdin(capsys): run_return_value = run(["--log", "--stdin"]) patched_stdin.isatty.assert_called_once() captured = capsys.readouterr() + normalized_string = " ".join(captured.out.split()) matches = re.search( ONE_ERROR_REGEX, - captured.out, + normalized_string, re.MULTILINE, ) assert matches is not None diff --git a/tests/utils.py b/tests/utils.py index 6ba8248..06aa3e8 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -129,11 +129,9 @@ def j2lint_default_rules_string(): ONE_ERROR_REGEX = ( - r"────────────────────────────── JINJA2 LINT ERRORS ──────────────────────────────\n" - r"📄 .*.j2\n" - r"└── (.*.j2):1 Jinja \n" - r" statement should have a single space before and after: '{% statement %}' \n" - r" \(jinja-statements-single-space\)\n" - r"\n" - r"Jinja2 linting finished with 1 error\(s\) and 0 warning\(s\)\n" + r"────────────────────────────── JINJA2 LINT ERRORS ────────────────────────────── " + r"📄 .*.j2 " + r"└── (.*.j2):1 Jinja statement should have a single space before and " + r"after: '{% statement %}' \(jinja-statements-single-space\) " + r"Jinja2 linting finished with 1 error\(s\) and 0 warning\(s\)" )