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

configure pytest to be stricter #1040

Merged
merged 9 commits into from Sep 11, 2020
17 changes: 16 additions & 1 deletion setup.cfg
Expand Up @@ -16,4 +16,19 @@ profile = black
combine_as_imports = True

[tool:pytest]
addopts = --cov-report= --cov=starlette --cov=tests -rxXs
addopts =
--cov-report=term-missing:skip-covered
--cov=starlette
--cov=tests
-rxXs
--strict-config
--strict-markers
--cov-config tests/.ignore_lifespan
graingert marked this conversation as resolved.
Show resolved Hide resolved
graingert marked this conversation as resolved.
Show resolved Hide resolved
--cov-fail-under=100
graingert marked this conversation as resolved.
Show resolved Hide resolved
graingert marked this conversation as resolved.
Show resolved Hide resolved
xfail_strict=True
filterwarnings=
error
graingert marked this conversation as resolved.
Show resolved Hide resolved
ignore: "@coroutine" decorator is deprecated.*:DeprecationWarning
graingert marked this conversation as resolved.
Show resolved Hide resolved
ignore: Using or importing the ABCs from 'collections' instead of from 'collections\.abc' is deprecated.*:DeprecationWarning
graingert marked this conversation as resolved.
Show resolved Hide resolved
ignore: The 'context' alias has been deprecated. Please use 'context_value' instead\.:DeprecationWarning
ignore: The 'variables' alias has been deprecated. Please use 'variable_values' instead\.:DeprecationWarning
4 changes: 2 additions & 2 deletions tests/test_datastructures.py
Expand Up @@ -213,13 +213,13 @@ def test_queryparams():
assert QueryParams(q) == q


class TestUploadFile(UploadFile):
class _TestUploadFile(UploadFile):
graingert marked this conversation as resolved.
Show resolved Hide resolved
spool_max_size = 1024


@pytest.mark.asyncio
async def test_upload_file():
big_file = TestUploadFile("big-file")
big_file = _TestUploadFile("big-file")
graingert marked this conversation as resolved.
Show resolved Hide resolved
await big_file.write(b"big-data" * 512)
await big_file.write(b"big-data")
await big_file.seek(0)
Expand Down