pytest-exasol-slc


Namepytest-exasol-slc JSON
Version 0.4.1 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2025-08-03 07:52:44
maintainerNone
docs_urlNone
authorMikhail Beck
requires_python<4.0,>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytest-exasol-slc Plugin

The `pytest-exasol-slc` plugin provides a pytest fixtures for building and uploading a script language container
into the database. The fixtures are backend agnostic. They run for the selected backends
(see the documentation for the `pytest-exasol-backend` plugin).

## Installation

The pytest-exasol-slc plugin can be installed using pip:

```shell
pip install pytest-exasol-slc
```

## Usage in Tests

Below is an example of a test that requires a script language container to be built and deployed in the database.
The example test case overrides two fixtures used internally by the fixture `deployed_slc` in this plugin:
* Fixture `language_alias` provides a meaningful name for the language alias.
* Fixture `slc_builder` prepares the structure of the SLC used in the example test case.

The language container will be activated with value returned by the fixture `language_alias`.
Note, that by default the test will run twice - once for each backend.

```python
import pytest

@pytest.fixture(scope='session')
def language_alias():
    return "MY_LANGUAGE_ALIAS"

@pytest.fixture(scope='session')
def slc_builder(use_onprem, use_saas):
    if use_onprem or use_saas:
        with language_container_factory() as container_builder:
            yield container_builder
    else:
        yield None

def test_something_with_slc(deployed_slc):
    ...
```

Alternatively, the language container can be deployed using the function version of this fixture. The function
can be called multiple times providing an opportunity to activate the language container with different
aliases.

```python
import pytest

@pytest.fixture(scope='session')
def slc_builder(use_onprem, use_saas):
    if use_onprem or use_saas:
        with language_container_factory() as container_builder:
            yield container_builder
    else:
        yield None

def test_something_with_slc(deploy_slc):
    deploy_slc("MY_LANGUAGE_ALIAS")
    ...
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytest-exasol-slc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Mikhail Beck",
    "author_email": "mikhail.beck@exasol.com",
    "download_url": "https://files.pythonhosted.org/packages/bc/0b/aa9d2f952dfde0a89e0db2179b7a48dcf9b8397d6bdc0d70a178508c0ff9/pytest_exasol_slc-0.4.1.tar.gz",
    "platform": null,
    "description": "# pytest-exasol-slc Plugin\n\nThe `pytest-exasol-slc` plugin provides a pytest fixtures for building and uploading a script language container\ninto the database. The fixtures are backend agnostic. They run for the selected backends\n(see the documentation for the `pytest-exasol-backend` plugin).\n\n## Installation\n\nThe pytest-exasol-slc plugin can be installed using pip:\n\n```shell\npip install pytest-exasol-slc\n```\n\n## Usage in Tests\n\nBelow is an example of a test that requires a script language container to be built and deployed in the database.\nThe example test case overrides two fixtures used internally by the fixture `deployed_slc` in this plugin:\n* Fixture `language_alias` provides a meaningful name for the language alias.\n* Fixture `slc_builder` prepares the structure of the SLC used in the example test case.\n\nThe language container will be activated with value returned by the fixture `language_alias`.\nNote, that by default the test will run twice - once for each backend.\n\n```python\nimport pytest\n\n@pytest.fixture(scope='session')\ndef language_alias():\n    return \"MY_LANGUAGE_ALIAS\"\n\n@pytest.fixture(scope='session')\ndef slc_builder(use_onprem, use_saas):\n    if use_onprem or use_saas:\n        with language_container_factory() as container_builder:\n            yield container_builder\n    else:\n        yield None\n\ndef test_something_with_slc(deployed_slc):\n    ...\n```\n\nAlternatively, the language container can be deployed using the function version of this fixture. The function\ncan be called multiple times providing an opportunity to activate the language container with different\naliases.\n\n```python\nimport pytest\n\n@pytest.fixture(scope='session')\ndef slc_builder(use_onprem, use_saas):\n    if use_onprem or use_saas:\n        with language_container_factory() as container_builder:\n            yield container_builder\n    else:\n        yield None\n\ndef test_something_with_slc(deploy_slc):\n    deploy_slc(\"MY_LANGUAGE_ALIAS\")\n    ...\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "0.4.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "313f7f785258a795118bc4eae3e6bef5585abf5adf200c8061476f943affb350",
                "md5": "dbbc84d0c42340834c98e7a3d9968d72",
                "sha256": "a3d366d1f99a8011f0a1da44caa709042c82928e6e9fdfd8c82e777a4e255313"
            },
            "downloads": -1,
            "filename": "pytest_exasol_slc-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dbbc84d0c42340834c98e7a3d9968d72",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 4774,
            "upload_time": "2025-08-03T07:52:42",
            "upload_time_iso_8601": "2025-08-03T07:52:42.762241Z",
            "url": "https://files.pythonhosted.org/packages/31/3f/7f785258a795118bc4eae3e6bef5585abf5adf200c8061476f943affb350/pytest_exasol_slc-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc0baa9d2f952dfde0a89e0db2179b7a48dcf9b8397d6bdc0d70a178508c0ff9",
                "md5": "217fdce5cdbf3146bf57368e95028317",
                "sha256": "08ada14b93b024fea46e6bff76a2bbc81a8d9682ec2e93b4d6b555766706aab5"
            },
            "downloads": -1,
            "filename": "pytest_exasol_slc-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "217fdce5cdbf3146bf57368e95028317",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 3872,
            "upload_time": "2025-08-03T07:52:44",
            "upload_time_iso_8601": "2025-08-03T07:52:44.943351Z",
            "url": "https://files.pythonhosted.org/packages/bc/0b/aa9d2f952dfde0a89e0db2179b7a48dcf9b8397d6bdc0d70a178508c0ff9/pytest_exasol_slc-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-03 07:52:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pytest-exasol-slc"
}
        
Elapsed time: 1.60094s