Skip to content

Commit

Permalink
fix tests/test_datastructures::TestUploadFile PytestCollectionWarning
Browse files Browse the repository at this point in the history
enhance pytest strictness to catch warnings that would have prevented
thest TestUploadFile file warning

restore cov-report and require 100% coverage
  • Loading branch information
graingert committed Sep 6, 2020
1 parent b95acea commit c923a96
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
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
--cov-fail-under=100
xfail_strict=True
filterwarnings=
error
ignore: "@coroutine" decorator is deprecated.*:DeprecationWarning
ignore: Using or importing the ABCs from 'collections' instead of from 'collections\.abc' is deprecated.*:DeprecationWarning
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):
spool_max_size = 1024


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

0 comments on commit c923a96

Please sign in to comment.