Skip to content

Commit

Permalink
Use e3 pytest plugin
Browse files Browse the repository at this point in the history
See AdaCore/e3-core#703
Remove conftest and coverage files coming from e3-core that are
available in the e3 pytest plugin.
  • Loading branch information
enzbang committed Apr 3, 2024
1 parent e86e7e9 commit b0306ea
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 187 deletions.
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ check = [
[tool.setuptools.dynamic]
version = {file = "VERSION"}

[tool.coverage.report]
exclude_also = [
"if tries < max_tries:"
]

[tool.coverage.run]
branch = false

[tool.coverage.html]
title = "e3 aws coverage report"

[tool.mypy]
# Ensure mypy works with namespace in which there is no toplevel
# __init__.py. Explicit_package_bases means that that mypy_path
Expand Down
4 changes: 3 additions & 1 deletion src/e3/aws/dynamodb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def batch_get_items(
res.extend(response.get("Responses", {table_name: []})[table_name])
logger.debug(f"Get_item response: {response}")
unprocessed = response["UnprocessedKeys"]
if len(unprocessed) > 0:
if len(unprocessed) > 0: # all: no cover"
# Testing this case is difficult as it requires a table
# with more than 16MB of data
batch_keys = unprocessed
unprocessed_count = sum(
[len(batch_key["Keys"]) for batch_key in batch_keys.values()] # type: ignore
Expand Down
34 changes: 0 additions & 34 deletions tests/conftest.py

This file was deleted.

23 changes: 0 additions & 23 deletions tests/coverage/base.rc

This file was deleted.

4 changes: 0 additions & 4 deletions tests/coverage/darwin.rc

This file was deleted.

4 changes: 0 additions & 4 deletions tests/coverage/linux.rc

This file was deleted.

3 changes: 0 additions & 3 deletions tests/coverage/windows.rc

This file was deleted.

33 changes: 0 additions & 33 deletions tests/fix-coverage-paths.py

This file was deleted.

76 changes: 0 additions & 76 deletions tests/gen-cov-config.py

This file was deleted.

11 changes: 2 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ passenv = APPVEYOR*,CI,GITHUB_*,CODECOV_*

# Run testsuite with coverage when '-cov' is in the env name
commands=
{envpython} {toxinidir}/tests/gen-cov-config.py {toxinidir}/.coveragerc
py.test --ignore=build -vv \
pytest --ignore=build -vv --e3 \
cov: --e3-cov-rewrite {envsitepackagesdir} src \
cov: --cov {envsitepackagesdir}/e3/aws --cov-report= --cov-fail-under=0 \
[]
cov: {envpython} {toxinidir}/tests/fix-coverage-paths.py \
cov: {envsitepackagesdir} {toxinidir}/.coverage
cov: coverage html --fail-under=0
cov: coverage report
codecov: codecov

[testenv:check]
Expand All @@ -39,9 +35,6 @@ ignore = E123,E133,E241,E242,W503,W504
[pydocstyle]
ignore = D100,D101,D102,D102,D103,D104,D105,D203,D403,D213

[pytest]
addopts = --failed-first

[flake8]
exclude = .git,__pycache__,build,dist,.tox
ignore = B905, C901, E203, E266, E501, W503,D100,D101,D102,D102,D103,D104,D105,D106,D107,D203,D403,D213
Expand Down

0 comments on commit b0306ea

Please sign in to comment.