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
18 changes: 17 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,20 @@ 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
xfail_strict=True
filterwarnings=
# Turn warnings that aren't filtered into exceptions
error
graingert marked this conversation as resolved.
Show resolved Hide resolved
# https://github.com/Tinche/aiofiles/issues/81
ignore: "@coroutine" decorator is deprecated.*:DeprecationWarning
graingert marked this conversation as resolved.
Show resolved Hide resolved
# https://github.com/graphql-python/graphene/issues/1055
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
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ def test_queryparams():
assert QueryParams(q) == q


class TestUploadFile(UploadFile):
class BigUploadFile(UploadFile):
spool_max_size = 1024


@pytest.mark.asyncio
async def test_upload_file():
big_file = TestUploadFile("big-file")
big_file = BigUploadFile("big-file")
await big_file.write(b"big-data" * 512)
await big_file.write(b"big-data")
await big_file.seek(0)
Expand Down