From 7207a0b0f8e8ed3c93b6d17c040e21a352f33470 Mon Sep 17 00:00:00 2001 From: Automatic Dependency Updater Date: Mon, 1 Jun 2026 04:34:47 +0000 Subject: [PATCH 1/5] Updated poetry.lock --- poetry.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/poetry.lock b/poetry.lock index 65b329a..5a4281d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.4.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.3.0 and should not be changed by hand. [[package]] name = "accessible-pygments" @@ -2188,14 +2188,14 @@ re2 = ["google-re2 (>=1.1)"] [[package]] name = "pip" -version = "26.1.1" +version = "26.1.2" description = "The PyPA recommended tool for installing Python packages." optional = false python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "pip-26.1.1-py3-none-any.whl", hash = "sha256:99cb1c2899893b075ff56e4ed0af55669a955b49ad7fb8d8603ecdaf4ed653fb"}, - {file = "pip-26.1.1.tar.gz", hash = "sha256:d36762751d156a4ee895de8af39aa0abeeeb577f93a2eca6ab62467bbf0f8a78"}, + {file = "pip-26.1.2-py3-none-any.whl", hash = "sha256:382ff9f685ee3bc25864f820aa50505825f10f5458ffff07e30a6d96e5715cab"}, + {file = "pip-26.1.2.tar.gz", hash = "sha256:f49cd134c61cf2fd75e0ce2676db03e4054504a5a4986d00f8299ae632dc4605"}, ] [[package]] @@ -2597,8 +2597,8 @@ astroid = ">=4.0.2,<=4.1.dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, - {version = ">=0.3.6", markers = "python_version == \"3.11\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, + {version = ">=0.3.6", markers = "python_version == \"3.11\""}, ] isort = ">=5,<5.13 || >5.13,<9" mccabe = ">=0.6,<0.8" @@ -3780,14 +3780,14 @@ keyring = ["keyring (>=21.2.0)"] [[package]] name = "typer" -version = "0.26.3" +version = "0.26.4" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." optional = false python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "typer-0.26.3-py3-none-any.whl", hash = "sha256:e70549ec5a403ca8a0bf0802ddd9f3c6ff7a14ccbb859b01b697baa943636f33"}, - {file = "typer-0.26.3.tar.gz", hash = "sha256:3e2b9352f535e5303ef27806dadc2c8647687bdca5c902f03fec3fb88f46a46a"}, + {file = "typer-0.26.4-py3-none-any.whl", hash = "sha256:11bfd7b43557137e373c2b10f6967a555f9678a61ed72c808968b011d95534d6"}, + {file = "typer-0.26.4.tar.gz", hash = "sha256:25b128964de66c5ea36d5ac82adc579e5e113509b17469edf9f5a4a1864ff2a9"}, ] [package.dependencies] @@ -3843,14 +3843,14 @@ zstd = ["backports-zstd (>=1.0.0) ; python_version < \"3.14\""] [[package]] name = "virtualenv" -version = "21.4.1" +version = "21.4.2" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.8" groups = ["dev"] files = [ - {file = "virtualenv-21.4.1-py3-none-any.whl", hash = "sha256:caf4ff72d1b4039057f41d8e8466e859513d67c0400d9c6b62c02c9d1ebc3e12"}, - {file = "virtualenv-21.4.1.tar.gz", hash = "sha256:2ca543c713b72840ceffd94e9bdedfbd09a661defa1f7f69e5429ad4059442e2"}, + {file = "virtualenv-21.4.2-py3-none-any.whl", hash = "sha256:854210ca524a1a4d0d744734f4acbc721c3ffe163b85bbf5d56d14d5ae2f0fae"}, + {file = "virtualenv-21.4.2.tar.gz", hash = "sha256:38e6ee0a555615c0ea9da2ac7e9998fe8dc3b911dd33ad8eaad2020957653b0c"}, ] [package.dependencies] From 266156c92566cf66afc256707933f5d0efec1a24 Mon Sep 17 00:00:00 2001 From: ckunki Date: Mon, 1 Jun 2026 09:35:39 +0200 Subject: [PATCH 2/5] Added generated workflow files .github/workflows/matrix-all.yml .github/workflows/matrix-exasol.yml --- .github/workflows/matrix-all.yml | 39 +++++++++++++++++++++++++++++ .github/workflows/matrix-exasol.yml | 39 +++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/matrix-all.yml create mode 100644 .github/workflows/matrix-exasol.yml diff --git a/.github/workflows/matrix-all.yml b/.github/workflows/matrix-all.yml new file mode 100644 index 0000000..0dbb308 --- /dev/null +++ b/.github/workflows/matrix-all.yml @@ -0,0 +1,39 @@ +# Generated and maintained by the exasol-toolbox. +# Last generated with exasol-toolbox version 8.1.1. +name: Build Matrix (All Versions) + +on: + workflow_call: + outputs: + matrix: + description: "Generates the all versions build matrix" + value: ${{ jobs.set-matrix-all.outputs.matrix }} + +jobs: + set-matrix-all: + runs-on: "ubuntu-24.04" + permissions: + contents: read + steps: + - name: Check out Repository + id: check-out-repository + uses: actions/checkout@v6 + + - name: Set up Python & Poetry Environment + id: set-up-python-and-poetry-environment + uses: exasol/python-toolbox/.github/actions/python-environment@v8 + with: + python-version: "3.10" + poetry-version: "2.3.0" + + - name: Generate Matrix + id: generate-matrix + run: poetry run -- nox -s matrix:all + + - name: Set Matrix + id: set-matrix + run: | + echo "matrix=$(poetry run -- nox -s matrix:all)" >> $GITHUB_OUTPUT + + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} diff --git a/.github/workflows/matrix-exasol.yml b/.github/workflows/matrix-exasol.yml new file mode 100644 index 0000000..24c4c4d --- /dev/null +++ b/.github/workflows/matrix-exasol.yml @@ -0,0 +1,39 @@ +# Generated and maintained by the exasol-toolbox. +# Last generated with exasol-toolbox version 8.1.1. +name: Build Matrix (Exasol) + +on: + workflow_call: + outputs: + matrix: + description: "Generates the exasol version build matrix" + value: ${{ jobs.set-matrix-exasol.outputs.matrix }} + +jobs: + set-matrix-exasol: + runs-on: "ubuntu-24.04" + permissions: + contents: read + steps: + - name: Check out Repository + id: check-out-repository + uses: actions/checkout@v6 + + - name: Set up Python & Poetry Environment + id: set-up-python-and-poetry-environment + uses: exasol/python-toolbox/.github/actions/python-environment@v8 + with: + python-version: "3.10" + poetry-version: "2.3.0" + + - name: Generate Matrix + id: generate-matrix + run: poetry run -- nox -s matrix:exasol + + - name: Set Matrix + id: set-matrix + run: | + echo "matrix=$(poetry run -- nox -s matrix:exasol)" >> $GITHUB_OUTPUT + + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} From 3d10c4afbb89154345eeb40ce40ea2eef0928da8 Mon Sep 17 00:00:00 2001 From: ckunki Date: Mon, 1 Jun 2026 09:50:59 +0200 Subject: [PATCH 3/5] Updated pytest --- .github/workflows/matrix-all.yml | 39 ---------------------- .github/workflows/matrix-exasol.yml | 39 ---------------------- poetry.lock | 51 ++++++++++------------------- 3 files changed, 18 insertions(+), 111 deletions(-) delete mode 100644 .github/workflows/matrix-all.yml delete mode 100644 .github/workflows/matrix-exasol.yml diff --git a/.github/workflows/matrix-all.yml b/.github/workflows/matrix-all.yml deleted file mode 100644 index 0dbb308..0000000 --- a/.github/workflows/matrix-all.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Generated and maintained by the exasol-toolbox. -# Last generated with exasol-toolbox version 8.1.1. -name: Build Matrix (All Versions) - -on: - workflow_call: - outputs: - matrix: - description: "Generates the all versions build matrix" - value: ${{ jobs.set-matrix-all.outputs.matrix }} - -jobs: - set-matrix-all: - runs-on: "ubuntu-24.04" - permissions: - contents: read - steps: - - name: Check out Repository - id: check-out-repository - uses: actions/checkout@v6 - - - name: Set up Python & Poetry Environment - id: set-up-python-and-poetry-environment - uses: exasol/python-toolbox/.github/actions/python-environment@v8 - with: - python-version: "3.10" - poetry-version: "2.3.0" - - - name: Generate Matrix - id: generate-matrix - run: poetry run -- nox -s matrix:all - - - name: Set Matrix - id: set-matrix - run: | - echo "matrix=$(poetry run -- nox -s matrix:all)" >> $GITHUB_OUTPUT - - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} diff --git a/.github/workflows/matrix-exasol.yml b/.github/workflows/matrix-exasol.yml deleted file mode 100644 index 24c4c4d..0000000 --- a/.github/workflows/matrix-exasol.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Generated and maintained by the exasol-toolbox. -# Last generated with exasol-toolbox version 8.1.1. -name: Build Matrix (Exasol) - -on: - workflow_call: - outputs: - matrix: - description: "Generates the exasol version build matrix" - value: ${{ jobs.set-matrix-exasol.outputs.matrix }} - -jobs: - set-matrix-exasol: - runs-on: "ubuntu-24.04" - permissions: - contents: read - steps: - - name: Check out Repository - id: check-out-repository - uses: actions/checkout@v6 - - - name: Set up Python & Poetry Environment - id: set-up-python-and-poetry-environment - uses: exasol/python-toolbox/.github/actions/python-environment@v8 - with: - python-version: "3.10" - poetry-version: "2.3.0" - - - name: Generate Matrix - id: generate-matrix - run: poetry run -- nox -s matrix:exasol - - - name: Set Matrix - id: set-matrix - run: | - echo "matrix=$(poetry run -- nox -s matrix:exasol)" >> $GITHUB_OUTPUT - - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} diff --git a/poetry.lock b/poetry.lock index 5a4281d..ff7d838 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2350,22 +2350,22 @@ tests = ["pytest", "pytest-cov", "pytest-lazy-fixtures"] [[package]] name = "prysk" -version = "0.20.0" +version = "0.15.2" description = "Functional tests for command line applications" optional = false -python-versions = "<4.0.0,>=3.8" +python-versions = ">=3.7,<4.0.0" groups = ["dev"] files = [ - {file = "prysk-0.20.0-py3-none-any.whl", hash = "sha256:3758f59febe1ff27710c8ba69a8edad42286050d041ed8df519fc4bbeea41133"}, - {file = "prysk-0.20.0.tar.gz", hash = "sha256:3499d24c9c8d534754d3915218cb2ab59cf59a8d6f37acfb68dc582650e67e33"}, + {file = "prysk-0.15.2-py3-none-any.whl", hash = "sha256:9c571b31166bd0db1b2ea1b6d5f8fb6e6335d6172c9921ee3f9e680f6649a81d"}, + {file = "prysk-0.15.2.tar.gz", hash = "sha256:953b608561daed91aced9856fcd9e008e963c07e4bf1684d79be0b218d29b8bd"}, ] [package.dependencies] -pytest-prysk = {version = ">=0.2.0,<0.3.0", optional = true, markers = "extra == \"pytest-plugin\""} +pytest = {version = ">=7.0.1", optional = true, markers = "extra == \"pytest-plugin\""} rich = ">=13.3.1,<14.0.0" [package.extras] -pytest-plugin = ["pytest-prysk (>=0.2.0,<0.3.0)"] +pytest-plugin = ["pytest (>=7.0.1)"] [[package]] name = "py-serializable" @@ -2644,42 +2644,27 @@ tomli = ">=2.0,<3" [[package]] name = "pytest" -version = "7.4.4" +version = "9.0.3" description = "pytest: simple powerful testing with Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, - {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, + {file = "pytest-9.0.3-py3-none-any.whl", hash = "sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9"}, + {file = "pytest-9.0.3.tar.gz", hash = "sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c"}, ] [package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} +colorama = {version = ">=0.4", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1", markers = "python_version < \"3.11\""} +iniconfig = ">=1.0.1" +packaging = ">=22" +pluggy = ">=1.5,<2" +pygments = ">=2.7.2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytest-prysk" -version = "0.2.0" -description = "Pytest plugin for prysk" -optional = false -python-versions = ">=3.8,<4.0" -groups = ["dev"] -files = [ - {file = "pytest_prysk-0.2.0-py3-none-any.whl", hash = "sha256:3180a9d3a6634e6e70107b2eed2a6a7420630b14ba2036598ef690f9b71be79f"}, - {file = "pytest_prysk-0.2.0.tar.gz", hash = "sha256:488d1f77e35beec9cad13e11368dcc5d09555ec31a4d6a3f9d901e78bbeeb2d1"}, -] - -[package.dependencies] -prysk = ">=0.15.0" -pytest = ">=7.3.2,<8.0.0" +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests", "setuptools", "xmlschema"] [[package]] name = "python-discovery" From 2c8c0cbc4393114507698d1d78d380a319235daf Mon Sep 17 00:00:00 2001 From: ckunki Date: Mon, 1 Jun 2026 10:59:19 +0200 Subject: [PATCH 4/5] Removed prysk and replaced integration tests by ordinary pytest itests --- .gitignore | 3 + doc/dependencies.rst | 2 - poetry.lock | 21 +---- pyproject.toml | 1 - test/integration/cli_integration_test.py | 114 ++++++++++++++++++++++ test/integration/generate-subcommand.t | 115 ----------------------- test/integration/parse-subcommand.t | 101 -------------------- 7 files changed, 118 insertions(+), 239 deletions(-) create mode 100644 test/integration/cli_integration_test.py delete mode 100644 test/integration/generate-subcommand.t delete mode 100644 test/integration/parse-subcommand.t diff --git a/.gitignore b/.gitignore index 04b6a6f..743bfba 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,6 @@ doc/_build .lint.json .lint.txt + +/.serena +/.codex diff --git a/doc/dependencies.rst b/doc/dependencies.rst index bd6353f..8b34844 100644 --- a/doc/dependencies.rst +++ b/doc/dependencies.rst @@ -19,9 +19,7 @@ Test Dependencies Dependency Purpose License ===================== ========================== ======== `Pytest`_ Testing framework MIT -`Prysk`_ Testing framework GPL ===================== ========================== ======== .. _Python 3: https://docs.python.org/3 .. _Pytest: https://docs.pytest.org/en/stable/ -.. _Prysk: https://www.prysk.net diff --git a/poetry.lock b/poetry.lock index ff7d838..db50717 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2348,25 +2348,6 @@ wcwidth = "*" [package.extras] tests = ["pytest", "pytest-cov", "pytest-lazy-fixtures"] -[[package]] -name = "prysk" -version = "0.15.2" -description = "Functional tests for command line applications" -optional = false -python-versions = ">=3.7,<4.0.0" -groups = ["dev"] -files = [ - {file = "prysk-0.15.2-py3-none-any.whl", hash = "sha256:9c571b31166bd0db1b2ea1b6d5f8fb6e6335d6172c9921ee3f9e680f6649a81d"}, - {file = "prysk-0.15.2.tar.gz", hash = "sha256:953b608561daed91aced9856fcd9e008e963c07e4bf1684d79be0b218d29b8bd"}, -] - -[package.dependencies] -pytest = {version = ">=7.0.1", optional = true, markers = "extra == \"pytest-plugin\""} -rich = ">=13.3.1,<14.0.0" - -[package.extras] -pytest-plugin = ["pytest (>=7.0.1)"] - [[package]] name = "py-serializable" version = "2.1.0" @@ -3893,4 +3874,4 @@ type = ["pytest-mypy (>=1.0.1) ; platform_python_implementation != \"PyPy\""] [metadata] lock-version = "2.1" python-versions = ">=3.10,<4.0" -content-hash = "0bf7929c8b8e3699c6f66635a019a12a86cc1ec56f1d4b48c92467e650d33756" +content-hash = "8b39bc1b4faf29f33a1b3a98b0bbf487a7d45d3537158759b8b5cf40c2d33542" diff --git a/pyproject.toml b/pyproject.toml index 8769921..0ddd07e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,6 @@ ec = "exasol.error._cli:main" [dependency-groups] dev = [ "pytest>=7.1.2,<10", - "prysk[pytest-plugin]>=0.15.1", "exasol-toolbox>=8.1.1, <9", ] diff --git a/test/integration/cli_integration_test.py b/test/integration/cli_integration_test.py new file mode 100644 index 0000000..f11f5c6 --- /dev/null +++ b/test/integration/cli_integration_test.py @@ -0,0 +1,114 @@ +import json +import os +import shutil +import subprocess +import sys +from pathlib import Path + +import pytest + +REPO_ROOT = Path(__file__).resolve().parents[2] +PYMODULE_CONTENT = """from exasol import error +from exasol.error import Parameter +error1 = error.ExaError( + "E-TEST-1", + "this is an error", + ["no mitigation available"], + {"param": Parameter("value", "some description")}, +) +error2 = error.ExaError( + "E-TEST-2", "this is an error", ["no mitigation available"], {"param": "value"} +) +""" +EXPECTED_ERRORS = [ + { + "identifier": "E-TEST-1", + "message": "this is an error", + "messagePlaceholders": [ + {"placeholder": "param", "description": "some description"} + ], + "description": None, + "internalDescription": None, + "potentialCauses": None, + "mitigations": ["no mitigation available"], + "sourceFile": "pymodule.py", + "sourceLine": 3, + "contextHash": None, + }, + { + "identifier": "E-TEST-2", + "message": "this is an error", + "messagePlaceholders": [{"placeholder": "param", "description": ""}], + "description": None, + "internalDescription": None, + "potentialCauses": None, + "mitigations": ["no mitigation available"], + "sourceFile": "pymodule.py", + "sourceLine": 9, + "contextHash": None, + }, +] + + +def _env(): + env = os.environ.copy() + pythonpath = env.get("PYTHONPATH") + env["PYTHONPATH"] = ( + f"{REPO_ROOT}{os.pathsep}{pythonpath}" if pythonpath else str(REPO_ROOT) + ) + return env + + +def _run(command: list[str], *args: str, cwd: Path) -> subprocess.CompletedProcess[str]: + return subprocess.run( + [*command, "--debug", *args], + cwd=cwd, + env=_env(), + check=True, + capture_output=True, + text=True, + ) + + +def _commands(): + yield pytest.param( + [sys.executable, "-m", "exasol.error"], id="module-entrypoint" + ) + ec_path = shutil.which("ec") + if ec_path: + yield pytest.param([ec_path], id="console-script") + else: + yield pytest.param( + [sys.executable, "-c", "from exasol.error._cli import main; main()"], + id="cli-module-fallback", + ) + + +@pytest.fixture +def sample_module(tmp_path: Path) -> Path: + module = tmp_path / "pymodule.py" + module.write_text(PYMODULE_CONTENT, encoding="utf-8") + return module + + +@pytest.mark.parametrize("command", _commands()) +def test_parse_subcommand(command: list[str], sample_module: Path): + result = _run(command, "parse", sample_module.name, cwd=sample_module.parent) + + assert result.stderr == "" + assert [json.loads(line) for line in result.stdout.splitlines()] == EXPECTED_ERRORS + + +@pytest.mark.parametrize("command", _commands()) +def test_generate_subcommand(command: list[str], sample_module: Path): + result = _run( + command, "generate", "modulename", "1.2.0", ".", cwd=sample_module.parent + ) + + assert result.stderr == "" + assert json.loads(result.stdout) == { + "$schema": "https://schemas.exasol.com/error_code_report-1.0.0.json", + "projectName": "modulename", + "projectVersion": "1.2.0", + "errorCodes": EXPECTED_ERRORS, + } diff --git a/test/integration/generate-subcommand.t b/test/integration/generate-subcommand.t deleted file mode 100644 index bbe1f8a..0000000 --- a/test/integration/generate-subcommand.t +++ /dev/null @@ -1,115 +0,0 @@ -Prepare Test - - $ export ROOT=$TESTDIR/../../ - - $ cat > pymodule.py << EOF - > from exasol import error - > from exasol.error import Parameter - > error1 = error.ExaError( - > "E-TEST-1", - > "this is an error", - > ["no mitigation available"], - > {"param": Parameter("value", "some description")}, - > ) - > error2 = error.ExaError( - > "E-TEST-2", "this is an error", ["no mitigation available"], {"param": "value"} - > ) - > EOF - -Test module entry point - - $ python -m exasol.error --debug generate modulename 1.2.0 . | python -m json.tool --json-lines - { - "$schema": "https://schemas.exasol.com/error_code_report-1.0.0.json", - "projectName": "modulename", - "projectVersion": "1.2.0", - "errorCodes": [ - { - "identifier": "E-TEST-1", - "message": "this is an error", - "messagePlaceholders": [ - { - "placeholder": "param", - "description": "some description" - } - ], - "description": null, - "internalDescription": null, - "potentialCauses": null, - "mitigations": [ - "no mitigation available" - ], - "sourceFile": "pymodule.py", - "sourceLine": 3, - "contextHash": null - }, - { - "identifier": "E-TEST-2", - "message": "this is an error", - "messagePlaceholders": [ - { - "placeholder": "param", - "description": "" - } - ], - "description": null, - "internalDescription": null, - "potentialCauses": null, - "mitigations": [ - "no mitigation available" - ], - "sourceFile": "pymodule.py", - "sourceLine": 9, - "contextHash": null - } - ] - } - -Test cli command - - $ ec --debug generate modulename 1.2.0 . | python -m json.tool --json-lines - { - "$schema": "https://schemas.exasol.com/error_code_report-1.0.0.json", - "projectName": "modulename", - "projectVersion": "1.2.0", - "errorCodes": [ - { - "identifier": "E-TEST-1", - "message": "this is an error", - "messagePlaceholders": [ - { - "placeholder": "param", - "description": "some description" - } - ], - "description": null, - "internalDescription": null, - "potentialCauses": null, - "mitigations": [ - "no mitigation available" - ], - "sourceFile": "pymodule.py", - "sourceLine": 3, - "contextHash": null - }, - { - "identifier": "E-TEST-2", - "message": "this is an error", - "messagePlaceholders": [ - { - "placeholder": "param", - "description": "" - } - ], - "description": null, - "internalDescription": null, - "potentialCauses": null, - "mitigations": [ - "no mitigation available" - ], - "sourceFile": "pymodule.py", - "sourceLine": 9, - "contextHash": null - } - ] - } diff --git a/test/integration/parse-subcommand.t b/test/integration/parse-subcommand.t deleted file mode 100644 index a666b21..0000000 --- a/test/integration/parse-subcommand.t +++ /dev/null @@ -1,101 +0,0 @@ -Prepare Test - - $ export ROOT=$TESTDIR/../../ - - $ cat > pymodule.py << EOF - > from exasol import error - > from exasol.error import Parameter - > error1 = error.ExaError( - > "E-TEST-1", - > "this is an error", - > ["no mitigation available"], - > {"param": Parameter("value", "some description")}, - > ) - > error2 = error.ExaError( - > "E-TEST-2", "this is an error", ["no mitigation available"], {"param": "value"} - > ) - > EOF - -Test module entry point - - $ python -m exasol.error --debug parse pymodule.py | python -m json.tool --json-lines - { - "identifier": "E-TEST-1", - "message": "this is an error", - "messagePlaceholders": [ - { - "placeholder": "param", - "description": "some description" - } - ], - "description": null, - "internalDescription": null, - "potentialCauses": null, - "mitigations": [ - "no mitigation available" - ], - "sourceFile": "pymodule.py", - "sourceLine": 3, - "contextHash": null - } - { - "identifier": "E-TEST-2", - "message": "this is an error", - "messagePlaceholders": [ - { - "placeholder": "param", - "description": "" - } - ], - "description": null, - "internalDescription": null, - "potentialCauses": null, - "mitigations": [ - "no mitigation available" - ], - "sourceFile": "pymodule.py", - "sourceLine": 9, - "contextHash": null - } - -Test cli command - - $ ec --debug parse pymodule.py | python -m json.tool --json-lines - { - "identifier": "E-TEST-1", - "message": "this is an error", - "messagePlaceholders": [ - { - "placeholder": "param", - "description": "some description" - } - ], - "description": null, - "internalDescription": null, - "potentialCauses": null, - "mitigations": [ - "no mitigation available" - ], - "sourceFile": "pymodule.py", - "sourceLine": 3, - "contextHash": null - } - { - "identifier": "E-TEST-2", - "message": "this is an error", - "messagePlaceholders": [ - { - "placeholder": "param", - "description": "" - } - ], - "description": null, - "internalDescription": null, - "potentialCauses": null, - "mitigations": [ - "no mitigation available" - ], - "sourceFile": "pymodule.py", - "sourceLine": 9, - "contextHash": null - } From ba6fd2ae58a253af640ee282ff6edf6adc35401f Mon Sep 17 00:00:00 2001 From: ckunki Date: Mon, 1 Jun 2026 11:07:06 +0200 Subject: [PATCH 5/5] nox -s format:fix --- test/integration/cli_integration_test.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/integration/cli_integration_test.py b/test/integration/cli_integration_test.py index f11f5c6..a03522a 100644 --- a/test/integration/cli_integration_test.py +++ b/test/integration/cli_integration_test.py @@ -71,9 +71,7 @@ def _run(command: list[str], *args: str, cwd: Path) -> subprocess.CompletedProce def _commands(): - yield pytest.param( - [sys.executable, "-m", "exasol.error"], id="module-entrypoint" - ) + yield pytest.param([sys.executable, "-m", "exasol.error"], id="module-entrypoint") ec_path = shutil.which("ec") if ec_path: yield pytest.param([ec_path], id="console-script")