Extra quality checks
Typing is now checked with mypy.
This commit is contained in:
parent
56fd486899
commit
dfccf9ef8a
19
README.md
19
README.md
@ -2,7 +2,10 @@
|
||||
|
||||
A pytest plugin to parametrize tests by CSV files.
|
||||
|
||||
[:toc:]
|
||||
[![PyPI - Downloads](https://img.shields.io/pypi/dw/pytest-csv-params?label=PyPI%20downloads&style=for-the-badge)](https://pypi.org/project/pytest-csv-params/)
|
||||
[![PyPI - Version](https://img.shields.io/pypi/v/pytest-csv-params?label=PyPI%20version&style=for-the-badge)](https://pypi.org/project/pytest-csv-params/)
|
||||
[![PyPI - Status](https://img.shields.io/pypi/status/pytest-csv-params?label=PyPI%20status&style=for-the-badge)](https://pypi.org/project/pytest-csv-params/)
|
||||
[![PyPI - Format](https://img.shields.io/pypi/format/pytest-csv-params?label=PyPI%20format&style=for-the-badge)](https://pypi.org/project/pytest-csv-params/)
|
||||
|
||||
## Requirements
|
||||
|
||||
@ -144,6 +147,20 @@ It would be great if you could include example code that clarifies your issue.
|
||||
|
||||
Pull requests are always welcome. Since this Gitea instance is not open to public, just send an e-mail to discuss options.
|
||||
|
||||
Any changes that are made are to be backed by tests. Please give me a sign if you're going to break the existing API and let us discuss ways to handle that.
|
||||
|
||||
### Quality Measures
|
||||
|
||||
Backed with pytest plugins:
|
||||
|
||||
- Pylint _(static code analysis and best practises)_
|
||||
- black _(code formatting standards)_
|
||||
- isort _(keep imports sorted)_
|
||||
- Bandit _(basic static security tests)_
|
||||
- mypy _(typechecking)_
|
||||
|
||||
Please to a complete pytest run (`poetry run pytest`), and consider running it on all supported platforms with (`poetry run tox`).
|
||||
|
||||
## License
|
||||
|
||||
Code is under MIT license. See `LICENSE.txt` for details.
|
||||
|
@ -26,7 +26,7 @@ class TestCaseParameters(TypedDict):
|
||||
data: List
|
||||
|
||||
|
||||
def read_csv(base_dir: BaseDir, data_file: DataFile, dialect: CsvDialect):
|
||||
def read_csv(base_dir: BaseDir, data_file: DataFile, dialect: CsvDialect) -> List[List[str]]:
|
||||
"""
|
||||
Get Data from CSV
|
||||
"""
|
||||
@ -53,8 +53,8 @@ def read_csv(base_dir: BaseDir, data_file: DataFile, dialect: CsvDialect):
|
||||
|
||||
|
||||
def add_parametrization(
|
||||
data_file: DataFile,
|
||||
base_dir: BaseDir = None,
|
||||
data_file: DataFile = None,
|
||||
id_col: IdColName = None,
|
||||
data_casts: DataCastDict = None,
|
||||
dialect: CsvDialect = CsvParamsDefaultDialect,
|
||||
|
42
poetry.lock
generated
42
poetry.lock
generated
@ -209,6 +209,24 @@ category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[[package]]
|
||||
name = "mypy"
|
||||
version = "0.971"
|
||||
description = "Optional static typing for Python"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
mypy-extensions = ">=0.4.3"
|
||||
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
|
||||
typing-extensions = ">=3.10"
|
||||
|
||||
[package.extras]
|
||||
reports = ["lxml"]
|
||||
python2 = ["typed-ast (>=1.4.0,<2)"]
|
||||
dmypy = ["psutil (>=4.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "mypy-extensions"
|
||||
version = "0.4.3"
|
||||
@ -426,6 +444,26 @@ pytest = ">=5.0"
|
||||
[package.extras]
|
||||
dev = ["pytest-asyncio", "tox", "pre-commit"]
|
||||
|
||||
[[package]]
|
||||
name = "pytest-mypy"
|
||||
version = "0.9.1"
|
||||
description = "Mypy static type checker plugin for Pytest"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[package.dependencies]
|
||||
attrs = ">=19.0"
|
||||
filelock = ">=3.0"
|
||||
mypy = [
|
||||
{version = ">=0.780", markers = "python_version >= \"3.9\""},
|
||||
{version = ">=0.700", markers = "python_version >= \"3.8\" and python_version < \"3.9\""},
|
||||
]
|
||||
pytest = [
|
||||
{version = ">=4.6", markers = "python_version >= \"3.6\" and python_version < \"3.10\""},
|
||||
{version = ">=6.2", markers = "python_version >= \"3.10\""},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytest-pylint"
|
||||
version = "0.18.0"
|
||||
@ -588,7 +626,7 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
|
||||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = "^3.8"
|
||||
content-hash = "109ba73e69f54a4f4610c2cc9153499d8d8fb6db5dffc48ab767779e4525be78"
|
||||
content-hash = "cd95b8ffb0cffc324682ca1e38a133f6a8643a4f8145d0ac26a0411d1145b376"
|
||||
|
||||
[metadata.files]
|
||||
astroid = []
|
||||
@ -621,6 +659,7 @@ iniconfig = [
|
||||
isort = []
|
||||
lazy-object-proxy = []
|
||||
mccabe = []
|
||||
mypy = []
|
||||
mypy-extensions = [
|
||||
{file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"},
|
||||
{file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"},
|
||||
@ -668,6 +707,7 @@ pytest-cov = [
|
||||
]
|
||||
pytest-isort = []
|
||||
pytest-mock = []
|
||||
pytest-mypy = []
|
||||
pytest-pylint = []
|
||||
pyyaml = []
|
||||
rich = []
|
||||
|
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "pytest-csv-params"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
description = "Pytest plugin for Test Case Parametrization with CSV files"
|
||||
authors = ["Juergen Edelbluth <csv_params@jued.de>"]
|
||||
license = "MIT"
|
||||
@ -41,7 +41,7 @@ packages = [
|
||||
"pytest-csv-params" = "pytest_csv_params.plugin"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = "--black --isort --pylint --pylint-rcfile=.pylintrc --cov --cov-report=term-missing --junitxml=test-reports/pytest_csv_params.xml"
|
||||
addopts = "--mypy --black --isort --pylint --pylint-rcfile=.pylintrc --cov --cov-report=term-missing --junitxml=test-reports/pytest_csv_params.xml"
|
||||
filterwarnings=[
|
||||
"ignore:.*BlackItem.*:_pytest.warning_types.PytestDeprecationWarning",
|
||||
"ignore:.*BlackItem.*:_pytest.warning_types.PytestRemovedIn8Warning",
|
||||
@ -117,7 +117,7 @@ include = '\.pyi?$'
|
||||
|
||||
[tool.isort]
|
||||
line_length = 120
|
||||
include_trailing_comma = "True"
|
||||
include_trailing_comma = true
|
||||
multi_line_output = 3
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
@ -134,6 +134,7 @@ pytest-pylint = "^0.18.0"
|
||||
pytest-mock = "^3.8.2"
|
||||
pytest-clarity = "^1.0.1"
|
||||
pytest-bandit = "^0.6.1"
|
||||
pytest-mypy = "^0.9.1"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
|
Loading…
Reference in New Issue
Block a user