Skip to content

Commit

Permalink
Add python toolbox to pytest-itde as dev dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Feb 8, 2024
1 parent 0509f01 commit e618f8d
Show file tree
Hide file tree
Showing 11 changed files with 1,101 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/


.lint.*
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ test +projects=PROJECTS:
#!/usr/bin/env bash
for p in {{projects}}; do
poetry -C ${p}/ install
poetry -C ${p}/ run pytest ${p}/test
poetry -C ${p}/ run nox -f ${p}/noxfile.py -s coverage
done
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import pyexasol
import pytest
from exasol_integration_test_docker_environment.lib.test_environment.ports import Ports

from exasol.pytest_itde import config
from exasol_integration_test_docker_environment.lib.test_environment.ports import Ports

EXASOL = config.OptionGroup(
prefix="exasol",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from collections import ChainMap
from dataclasses import dataclass
from typing import Generic, List, Optional, TypeVar
from typing import (
Generic,
List,
Optional,
TypeVar,
)

from pyexasol.connection import ExaConnection

Expand Down
10 changes: 10 additions & 0 deletions pytest-itde/exasol/pytest_itde/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ATTENTION:
# This file is generated by exasol/toolbox/pre_commit_hooks/package_version.py when using:
# * either "poetry run nox -s fix"
# * or "poetry run version-check <path/version.py> --fix"
# Do not edit this file manually!
# If you need to change the version, do so in the project.toml, e.g. by using `poetry version X.Y.Z`.
MAJOR = 0
MINOR = 1
PATCH = 0
VERSION = f"{MAJOR}.{MINOR}.{PATCH}"
39 changes: 39 additions & 0 deletions pytest-itde/noxconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Configuration for nox based task runner"""
from __future__ import annotations

from dataclasses import dataclass
from pathlib import Path
from typing import (
Any,
Iterable,
MutableMapping,
)

from nox import Session


@dataclass(frozen=True)
class Config:
"""Project specific configuration used by nox infrastructure"""

root: Path = Path(__file__).parent
doc: Path = Path(__file__).parent / "doc"
version_file: Path = Path(__file__).parent / "exasol" / "pytest_itde" / "version.py"
path_filters: Iterable[str] = ("dist", ".eggs", "venv", "metrics-schema")

@staticmethod
def pre_integration_tests_hook(
_session: Session, _config: Config, _context: MutableMapping[str, Any]
) -> bool:
"""Implement if project specific behaviour is required"""
return True

@staticmethod
def post_integration_tests_hook(
_session: Session, _config: Config, _context: MutableMapping[str, Any]
) -> bool:
"""Implement if project specific behaviour is required"""
return True


PROJECT_CONFIG = Config()
11 changes: 11 additions & 0 deletions pytest-itde/noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""defines nox tasks/targets for this project"""
import sys

import nox

print(sys.path)
# imports all nox task provided by the toolbox
from exasol.toolbox.nox.tasks import * # pylint: disable=wildcard-import disable=unused-wildcard-import

# default actions to be run if nothing is explicitly specified with the -s option
nox.options.sessions = ["fix"]
985 changes: 981 additions & 4 deletions pytest-itde/poetry.lock

Large diffs are not rendered by default.

43 changes: 42 additions & 1 deletion pytest-itde/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
description = ""
authors = ["Nicola Coretti <[email protected]>"]
readme = "README.md"
packages = [{include = "exasol", from = "src"}]
packages = [{include = "exasol"}]

[tool.poetry.dependencies]
python = ">=3.8,<4"
Expand All @@ -15,6 +15,47 @@ pyexasol = ">=0.25"
[tool.poetry.plugins.pytest11]
itde = "exasol.pytest_itde"


[tool.poetry.group.dev.dependencies]
exasol-toolbox = "0.8.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.coverage.run]
relative_files = true
source = [
"exasol",
]

[tool.coverage.report]
fail_under = 15


[tool.black]
line-length = 88
verbose = false
include = "\\.pyi?$"


[tool.isort]
profile = "black"
force_grid_wrap = 2


[tool.pylint.master]
fail-under = 8.1
output-format = "colorized,json:.lint.json,text:.lint.txt"

[tool.pylint.format]
max-line-length = 88
max-module-lines = 800


[[tool.mypy.overrides]]
module = [
"test.unit.*",
"test.integration.*",
]
ignore_errors = true
2 changes: 2 additions & 0 deletions pytest-itde/test/integration/smoke_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_smoke():
assert True
7 changes: 5 additions & 2 deletions pytest-itde/test/unit/plugin_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import pytest
from exasol_integration_test_docker_environment.lib.test_environment.ports import Ports

from exasol.pytest_itde import TestSchemas
from exasol.pytest_itde.config import Option, OptionGroup
from exasol_integration_test_docker_environment.lib.test_environment.ports import Ports
from exasol.pytest_itde.config import (
Option,
OptionGroup,
)

OPTIONS = (
Option(
Expand Down

0 comments on commit e618f8d

Please sign in to comment.