Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Qase SDK version and dependencies #56

Merged
merged 6 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.11", "3.12"]
fail-fast: false

steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,8 @@ fabric.properties

# pyenv
.python-version

# VS Code settings
.vscode/*
!.vscode/project-related-words.txt
!.vscode/cspell.json
37 changes: 8 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,17 @@ repos:
- id: check-merge-conflict
- id: detect-private-key

- repo: https://github.com/pycqa/isort
rev: 5.12.0
# Typo search tool
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.3.0
hooks:
- id: isort
name: isort (python)
- id: cspell

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: flake8
exclude: .venv|__init__.py
additional_dependencies: [
# A plugin for Flake8 finding likely bugs and design problems in your program.
# https://github.com/PyCQA/flake8-bugbear
flake8-bugbear,
# Extension to enforce better comma placement.
# https://github.com/PyCQA/flake8-commas
flake8-commas,
# A flake8 plugin that warn about backslashes usage.
# https://github.com/wemake-services/flake8-broken-line
# Disabled until support of flake8>=6.0.0, see
# https://github.com/wemake-services/flake8-broken-line/pull/280
# flake8-broken-line,
# A simple module that adds an extension for the fantastic pydocstyle tool to flake8.
# https://github.com/PyCQA/flake8-docstrings
flake8-docstrings,
# McCabe complexity checker.
# https://github.com/PyCQA/mccabe
mccabe,
# Configuring flake8 using pyproject.toml
Flake8-pyproject,
]
- id: ruff
- id: ruff-format

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
Expand Down
20 changes: 20 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"ignorePaths": [
".git/",
".gitignore",
".venv"
],
"dictionaryDefinitions": [
{
"name": "project-related-words",
"path": "./project-related-words.txt",
"addWords": true
}
],
"dictionaries": [
"python",
"python-common",
"docker",
"project-related-words"
]
}
29 changes: 29 additions & 0 deletions .vscode/project-related-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
addhooks
addinivalue
addoption
filelock
hookspecs
hookwrapper
modifyitems
nodeid
pluginmanager
Qase
qaseio
sessionstart
terminalreporter
tryfirst
trylast
workerinput
TASKNUMBER
Saritasa
wasxfail
longrepr
longreprtext
snok
autotests
autouse
fixturenames
getfixturevalue
conftests
makereport
firstresult
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

We follow [Semantic Versions](https://semver.org/).

# Version 2.0.0

- Use updated `qaseio` sdk (^4.0.0)
- Rework getting browser name (see `README.md`)
- Drop `Python 3.10` support
- Drop `pytest-variables` support (now use pytest options to provide browser name)
- Add `ruff` and `cspell` linters
- Small code and structure improvements

# Version 1.2.0

- Fix `filelock` blocking for parallel tests run
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,19 @@ def test_demo():
"""Check qaseio plugin works as expected."""
```

Since this package is mostly used for selenium tests, you need to provide a
value for `--webdriver` flag. If you set `--webdriver=remote` and want to specify
name of remote browser (not just Remote), use `--remote-browser`
flag or set capabilities via `variables`. This will be used in test run name and
in attachments path.
Since this package is mostly used for selenium tests, it expects to get browser
name to use in Qase.io test run name and in attachments path. By default you can
provide it using `--webdriver` flag. But you can also override
`pytest_qase_browser_name` hook to implement some custom logic.
Here's default implementation of hook:

```python
@pytest.hookimpl(trylast=True)
def pytest_qase_browser_name(config: pytest.Config) -> str:
"""Try to get browser name from `webdriver` pytest option."""
return config.getoption("--webdriver")

```

To enable plugin use flag `--qase-enabled`.

Expand Down
180 changes: 136 additions & 44 deletions poetry.lock

Large diffs are not rendered by default.

205 changes: 162 additions & 43 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "pytest-qaseio"
description = "Pytest plugin for Qase.io integration"
version = "1.2.0"
version = "2.0.0"
license = "MIT"

authors = [
Expand Down Expand Up @@ -35,8 +35,8 @@ classifiers = [
pytest_qaseio = "pytest_qaseio.plugin"

[tool.poetry.dependencies]
python = "^3.10"
qaseio = "^3.4.1"
python = "^3.11"
qaseio = "^4.0.0"
selenium = "^4.21.0"
arrow = "^1.3.0"
filelock = "^3.14.0"
Expand All @@ -60,7 +60,7 @@ enable_error_code = [

allow_redefinition = false
check_untyped_defs = true
disallow_any_explicit = true
disallow_any_explicit = false
disallow_any_generics = true
disallow_untyped_calls = true
ignore_errors = false
Expand All @@ -76,45 +76,164 @@ warn_redundant_casts = true
warn_unused_configs = true
warn_unreachable = true

[tool.isort]
# isort configuration:
# https://pycqa.github.io/isort/docs/configuration/options.html
line_length = 79
multi_line_output = 3
include_trailing_comma = true
[[tool.mypy.overrides]]
module = "qaseio.*"
implicit_reexport = true


[tool.ruff]
line-length = 100
indent-width = 4
target-version = "py311"
exclude = [
".venv",
"venv",
"__init__.py",
]

[tool.ruff.lint]
extend-select = [
# https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"W",
"E",
# https://docs.astral.sh/ruff/rules/#mccabe-c90
"C90",
# https://docs.astral.sh/ruff/rules/#isort-i
"I",
# https://docs.astral.sh/ruff/rules/#pep8-naming-n
"N",
# https://docs.astral.sh/ruff/rules/#pydocstyle-d
"D",
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP",
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN",
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S",
# https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"B",
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A",
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM",
# https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"C4",
# https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"DTZ",
# https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"T10",
# https://docs.astral.sh/ruff/rules/#flake8-django-dj
"DJ",
# https://docs.astral.sh/ruff/rules/#flake8-print-t20
"T20",
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"PT",
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SIM",
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"PTH",
# https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TD",
# https://docs.astral.sh/ruff/rules/#eradicate-era
"ERA",
# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF"
]

[tool.flake8]
# https://www.flake8rules.com/
ignore = [
# https://www.flake8rules.com/rules/E126.html
"E12",
# https://www.flake8rules.com/rules/W503.html
"W503",
# https://www.flake8rules.com/rules/W504.html
"W504",
# https://github.com/m-burst/flake8-pytest-style/blob/master/docs/rules/PT004.md
"PT004",
# Missing docstring in public module
"D100",
# Missing docstring in public method
"D102",
# Missing docstring in public function
"D103",
# Missing docstring in magic method
"D105",
# Missing docstring in public nested
"D106",
# Missing docstring in __init__
"D107",
# Manually surrounded by quotes, consider using the `!r` conversion flag
"B028",
# https://docs.astral.sh/ruff/rules/missing-type-self/
"ANN101",
# https://docs.astral.sh/ruff/rules/missing-type-cls/
"ANN102",
# https://docs.astral.sh/ruff/rules/missing-type-args/
"ANN002",
# https://docs.astral.sh/ruff/rules/missing-type-kwargs/
"ANN003",
# https://docs.astral.sh/ruff/rules/any-type/
"ANN401",
# https://docs.astral.sh/ruff/rules/missing-return-type-special-method/
"ANN204",
# https://docs.astral.sh/ruff/rules/undocumented-public-module/
"D100",
# https://docs.astral.sh/ruff/rules/undocumented-public-init/
"D107",
# https://docs.astral.sh/ruff/rules/undocumented-public-package/
"D104",
# https://docs.astral.sh/ruff/rules/undocumented-magic-method/
"D105",
# https://docs.astral.sh/ruff/rules/undocumented-public-nested-class/
"D106",
# https://docs.astral.sh/ruff/rules/one-blank-line-before-class/
"D203",
# https://docs.astral.sh/ruff/rules/multi-line-summary-second-line/
"D213",
# https://docs.astral.sh/ruff/rules/dashed-underline-after-section/
"D407",
# https://docs.astral.sh/ruff/rules/error-suffix-on-exception-name/
"N818",
# https://docs.astral.sh/ruff/rules/invalid-module-name/
"N999",
# https://docs.astral.sh/ruff/rules/unnecessary-collection-call/
"C408",
# https://docs.astral.sh/ruff/rules/mutable-class-default/
"RUF012",
# https://docs.astral.sh/ruff/rules/undocumented-public-module/
"D100",
# https://docs.astral.sh/ruff/rules/undocumented-public-method/
"D102",
# https://docs.astral.sh/ruff/rules/undocumented-public-function/
"D103",
# https://docs.astral.sh/ruff/rules/undocumented-magic-method/
"D105",
# https://docs.astral.sh/ruff/rules/undocumented-public-nested-class/
"D106",
# https://docs.astral.sh/ruff/rules/undocumented-public-init/
"D107",
# https://docs.astral.sh/ruff/rules/undefined-local-with-import-star/
"F403",
# https://docs.astral.sh/ruff/rules/capitalize-section-name/
"F405",
# https://docs.astral.sh/ruff/rules/pytest-missing-fixture-name-underscore/
"PT004",
# https://docs.astral.sh/ruff/rules/function-call-in-default-argument/
"B008",
# https://docs.astral.sh/ruff/rules/non-pep695-type-alias/
"UP040",
# https://docs.astral.sh/ruff/rules/assert/
"S101",
# https://docs.astral.sh/ruff/rules/missing-todo-author/
"TD002",
# https://docs.astral.sh/ruff/rules/missing-todo-link/
"TD003",
]


[tool.ruff.lint.isort]
force-wrap-aliases = true
split-on-trailing-comma = true
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"pages",
"local-folder",
]
inline-quotes = "double"
statistics = true
count = true
max-complexity = 10
max-line-length = 100
pytest-fixture-no-parentheses = true
pytest-parametrize-names-type = "list"
pytest-parametrize-values-type = "list"
pytest-parametrize-values-row-type = "list"


[tool.ruff.lint.isort.sections]
pages = ["pages"]


[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
parametrize-names-type = "list"
parametrize-values-type = "list"
parametrize-values-row-type = "list"


[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
Loading
Loading