The following issues were found
tests/test_tutorial/test_testing/test_tutorial002.py
3 issues
Line: 1
Column: 1
from docs_src.app_testing.tutorial002 import test_read_main, test_websocket
def test_main():
test_read_main()
def test_ws():
test_websocket()
Reported by Pylint.
Line: 4
Column: 1
from docs_src.app_testing.tutorial002 import test_read_main, test_websocket
def test_main():
test_read_main()
def test_ws():
test_websocket()
Reported by Pylint.
Line: 8
Column: 1
test_read_main()
def test_ws():
test_websocket()
Reported by Pylint.
tests/test_tutorial/test_custom_response/test_tutorial007.py
3 issues
Line: 1
Column: 1
from fastapi.testclient import TestClient
from docs_src.custom_response.tutorial007 import app
client = TestClient(app)
def test_get():
fake_content = b"some fake video bytes"
Reported by Pylint.
Line: 8
Column: 1
client = TestClient(app)
def test_get():
fake_content = b"some fake video bytes"
response = client.get("/")
assert response.content == fake_content * 10
Reported by Pylint.
Line: 11
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
def test_get():
fake_content = b"some fake video bytes"
response = client.get("/")
assert response.content == fake_content * 10
Reported by Bandit.
tests/test_tutorial/test_custom_response/test_tutorial008.py
3 issues
Line: 1
Column: 1
from pathlib import Path
from fastapi.testclient import TestClient
from docs_src.custom_response import tutorial008
from docs_src.custom_response.tutorial008 import app
client = TestClient(app)
Reported by Pylint.
Line: 11
Column: 1
client = TestClient(app)
def test_get(tmp_path: Path):
file_path: Path = tmp_path / "large-video-file.mp4"
tutorial008.some_file_path = str(file_path)
test_content = b"Fake video bytes"
file_path.write_bytes(test_content)
response = client.get("/")
Reported by Pylint.
Line: 17
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
test_content = b"Fake video bytes"
file_path.write_bytes(test_content)
response = client.get("/")
assert response.content == test_content
Reported by Bandit.
tests/test_tutorial/test_custom_response/test_tutorial009.py
3 issues
Line: 1
Column: 1
from pathlib import Path
from fastapi.testclient import TestClient
from docs_src.custom_response import tutorial009
from docs_src.custom_response.tutorial009 import app
client = TestClient(app)
Reported by Pylint.
Line: 11
Column: 1
client = TestClient(app)
def test_get(tmp_path: Path):
file_path: Path = tmp_path / "large-video-file.mp4"
tutorial009.some_file_path = str(file_path)
test_content = b"Fake video bytes"
file_path.write_bytes(test_content)
response = client.get("/")
Reported by Pylint.
Line: 17
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
test_content = b"Fake video bytes"
file_path.write_bytes(test_content)
response = client.get("/")
assert response.content == test_content
Reported by Bandit.
tests/utils.py
2 issues
Line: 3
Column: 1
import sys
import pytest
needs_py37 = pytest.mark.skipif(sys.version_info < (3, 7), reason="requires python3.7+")
needs_py39 = pytest.mark.skipif(sys.version_info < (3, 9), reason="requires python3.9+")
Reported by Pylint.
Line: 1
Column: 1
import sys
import pytest
needs_py37 = pytest.mark.skipif(sys.version_info < (3, 7), reason="requires python3.7+")
needs_py39 = pytest.mark.skipif(sys.version_info < (3, 9), reason="requires python3.9+")
Reported by Pylint.
tests/test_tutorial/test_testing/test_main_b.py
2 issues
Line: 1
Column: 1
from docs_src.app_testing import test_main_b
def test_app():
test_main_b.test_create_existing_item()
test_main_b.test_create_item()
test_main_b.test_create_item_bad_token()
test_main_b.test_read_inexistent_item()
test_main_b.test_read_item()
Reported by Pylint.
Line: 4
Column: 1
from docs_src.app_testing import test_main_b
def test_app():
test_main_b.test_create_existing_item()
test_main_b.test_create_item()
test_main_b.test_create_item_bad_token()
test_main_b.test_read_inexistent_item()
test_main_b.test_read_item()
Reported by Pylint.
docs_src/python_types/tutorial008.py
2 issues
Line: 1
Column: 1
from typing import Dict
def process_items(prices: Dict[str, float]):
for item_name, item_price in prices.items():
print(item_name)
print(item_price)
Reported by Pylint.
Line: 4
Column: 1
from typing import Dict
def process_items(prices: Dict[str, float]):
for item_name, item_price in prices.items():
print(item_name)
print(item_price)
Reported by Pylint.
docs_src/python_types/tutorial009.py
2 issues
Line: 1
Column: 1
from typing import Optional
def say_hi(name: Optional[str] = None):
if name is not None:
print(f"Hey {name}!")
else:
print("Hello World")
Reported by Pylint.
Line: 4
Column: 1
from typing import Optional
def say_hi(name: Optional[str] = None):
if name is not None:
print(f"Hey {name}!")
else:
print("Hello World")
Reported by Pylint.
fastapi/security/utils.py
2 issues
Line: 1
Column: 1
from typing import Tuple
def get_authorization_scheme_param(authorization_header_value: str) -> Tuple[str, str]:
if not authorization_header_value:
return "", ""
scheme, _, param = authorization_header_value.partition(" ")
return scheme, param
Reported by Pylint.
Line: 4
Column: 1
from typing import Tuple
def get_authorization_scheme_param(authorization_header_value: str) -> Tuple[str, str]:
if not authorization_header_value:
return "", ""
scheme, _, param = authorization_header_value.partition(" ")
return scheme, param
Reported by Pylint.
tests/test_tutorial/test_testing/test_tutorial003.py
2 issues
Line: 1
Column: 1
from docs_src.app_testing.tutorial003 import test_read_items
def test_main():
test_read_items()
Reported by Pylint.
Line: 4
Column: 1
from docs_src.app_testing.tutorial003 import test_read_items
def test_main():
test_read_items()
Reported by Pylint.