(.venv) bledy@lurker:flask_api_example$ pytest -vvW ignore::DeprecationWarning ================================================ test session starts ================================================= platform linux -- Python 3.7.5, pytest-5.3.2, py-1.8.0, pluggy-0.13.1 -- /home/bledy/GITHUB/flask_api_example/.venv/bin/python3 cachedir: .pytest_cache rootdir: /home/bledy/GITHUB/flask_api_example collected 78 items app/__init__test.py::test_app_creates PASSED [ 1%] app/__init__test.py::test_app_healthy PASSED [ 2%] app/fizz/fizzbar/controller_test.py::TestFizzbarResource::test_get FAILED [ 3%] app/fizz/fizzbar/controller_test.py::TestFizzbarResource::test_post FAILED [ 5%] app/fizz/fizzbar/controller_test.py::TestFizzbarIdResource::test_get PASSED [ 6%] app/fizz/fizzbar/controller_test.py::TestFizzbarIdResource::test_delete PASSED [ 7%] app/fizz/fizzbar/controller_test.py::TestFizzbarIdResource::test_put FAILED [ 8%] app/fizz/fizzbar/interface_test.py::test_FizzbarInterface_create PASSED [ 10%] app/fizz/fizzbar/interface_test.py::test_FizzbarInterface_works PASSED [ 11%] app/fizz/fizzbar/model_test.py::test_Fizzbar_create PASSED [ 12%] app/fizz/fizzbar/model_test.py::test_Fizzbar_retrieve PASSED [ 14%] app/fizz/fizzbar/schema_test.py::test_FizzbarSchema_create PASSED [ 15%] app/fizz/fizzbar/schema_test.py::test_FizzbarSchema_works FAILED [ 16%] app/fizz/fizzbar/service_test.py::test_get_all PASSED [ 17%] app/fizz/fizzbar/service_test.py::test_update PASSED [ 19%] app/fizz/fizzbar/service_test.py::test_delete_by_id PASSED [ 20%] app/fizz/fizzbar/service_test.py::test_create PASSED [ 21%] app/fizz/fizzbaz/controller_test.py::TestFizzbazResource::test_get FAILED [ 23%] app/fizz/fizzbaz/controller_test.py::TestFizzbazResource::test_post FAILED [ 24%] app/fizz/fizzbaz/controller_test.py::TestFizzbazIdResource::test_get PASSED [ 25%] app/fizz/fizzbaz/controller_test.py::TestFizzbazIdResource::test_delete PASSED [ 26%] app/fizz/fizzbaz/controller_test.py::TestFizzbazIdResource::test_put FAILED [ 28%] app/fizz/fizzbaz/interface_test.py::test_FizzbazInterface_create PASSED [ 29%] app/fizz/fizzbaz/interface_test.py::test_FizzbazInterface_works PASSED [ 30%] app/fizz/fizzbaz/model_test.py::test_Fizzbaz_create PASSED [ 32%] app/fizz/fizzbaz/model_test.py::test_Fizzbaz_retrieve PASSED [ 33%] app/fizz/fizzbaz/schema_test.py::test_FizzbazSchema_create PASSED [ 34%] app/fizz/fizzbaz/schema_test.py::test_FizzbazSchema_works FAILED [ 35%] app/fizz/fizzbaz/service_test.py::test_get_all PASSED [ 37%] app/fizz/fizzbaz/service_test.py::test_update PASSED [ 38%] app/fizz/fizzbaz/service_test.py::test_delete_by_id PASSED [ 39%] app/fizz/fizzbaz/service_test.py::test_create PASSED [ 41%] app/other_api/doodad/controller_test.py::TestDoodadResource::test_get FAILED [ 42%] app/other_api/doodad/controller_test.py::TestDoodadResource::test_post FAILED [ 43%] app/other_api/doodad/controller_test.py::TestDoodadIdResource::test_get PASSED [ 44%] app/other_api/doodad/controller_test.py::TestDoodadIdResource::test_delete PASSED [ 46%] app/other_api/doodad/controller_test.py::TestDoodadIdResource::test_put FAILED [ 47%] app/other_api/doodad/interface_test.py::test_DoodadInterface_create PASSED [ 48%] app/other_api/doodad/interface_test.py::test_DoodadInterface_works PASSED [ 50%] app/other_api/doodad/model_test.py::test_Doodad_create PASSED [ 51%] app/other_api/doodad/model_test.py::test_Doodad_retrieve PASSED [ 52%] app/other_api/doodad/schema_test.py::test_DoodadSchema_create PASSED [ 53%] app/other_api/doodad/schema_test.py::test_DoodadSchema_works FAILED [ 55%] app/other_api/doodad/service_test.py::test_get_all PASSED [ 56%] app/other_api/doodad/service_test.py::test_update PASSED [ 57%] app/other_api/doodad/service_test.py::test_delete_by_id PASSED [ 58%] app/other_api/doodad/service_test.py::test_create PASSED [ 60%] app/other_api/whatsit/controller_test.py::TestWhatsitResource::test_get FAILED [ 61%] app/other_api/whatsit/controller_test.py::TestWhatsitResource::test_post FAILED [ 62%] app/other_api/whatsit/controller_test.py::TestWhatsitIdResource::test_get PASSED [ 64%] app/other_api/whatsit/controller_test.py::TestWhatsitIdResource::test_delete PASSED [ 65%] app/other_api/whatsit/controller_test.py::TestWhatsitIdResource::test_put FAILED [ 66%] app/other_api/whatsit/interface_test.py::test_WhatsitInterface_create PASSED [ 67%] app/other_api/whatsit/interface_test.py::test_WhatsitInterface_works PASSED [ 69%] app/other_api/whatsit/model_test.py::test_Whatsit_create PASSED [ 70%] app/other_api/whatsit/model_test.py::test_Whatsit_retrieve PASSED [ 71%] app/other_api/whatsit/schema_test.py::test_WhatsitSchema_create PASSED [ 73%] app/other_api/whatsit/schema_test.py::test_WhatsitSchema_works FAILED [ 74%] app/other_api/whatsit/service_test.py::test_get_all PASSED [ 75%] app/other_api/whatsit/service_test.py::test_update PASSED [ 76%] app/other_api/whatsit/service_test.py::test_delete_by_id PASSED [ 78%] app/other_api/whatsit/service_test.py::test_create PASSED [ 79%] app/shared/query/service_test.py::test_execute PASSED [ 80%] app/widget/controller_test.py::TestWidgetResource::test_get FAILED [ 82%] app/widget/controller_test.py::TestWidgetResource::test_post FAILED [ 83%] app/widget/controller_test.py::TestWidgetIdResource::test_get PASSED [ 84%] app/widget/controller_test.py::TestWidgetIdResource::test_delete PASSED [ 85%] app/widget/controller_test.py::TestWidgetIdResource::test_put FAILED [ 87%] app/widget/interface_test.py::test_WidgetInterface_create PASSED [ 88%] app/widget/interface_test.py::test_WidgetInterface_works PASSED [ 89%] app/widget/model_test.py::test_Widget_create PASSED [ 91%] app/widget/model_test.py::test_Widget_retrieve PASSED [ 92%] app/widget/schema_test.py::test_WidgetSchema_create PASSED [ 93%] app/widget/schema_test.py::test_WidgetSchema_works FAILED [ 94%] app/widget/service_test.py::test_get_all PASSED [ 96%] app/widget/service_test.py::test_update PASSED [ 97%] app/widget/service_test.py::test_delete_by_id PASSED [ 98%] app/widget/service_test.py::test_create PASSED [100%] ====================================================== FAILURES ====================================================== ____________________________________________ TestFizzbarResource.test_get ____________________________________________ self = client = > @patch.object( FizzbarService, "get_all", lambda: [ make_fizzbar(123, name="Test Fizzbar 1"), make_fizzbar(456, name="Test Fizzbar 2"), ], ) def test_get(self, client: FlaskClient): # noqa with client: results = client.get( f"/api/{BASE_ROUTE}/fizzbar", follow_redirects=True ).get_json() expected = ( FizzbarSchema(many=True) .dump( [ make_fizzbar(123, name="Test Fizzbar 1"), > make_fizzbar(456, name="Test Fizzbar 2"), ] ) .data ) E AttributeError: 'list' object has no attribute 'data' app/fizz/fizzbar/controller_test.py:37: AttributeError ___________________________________________ TestFizzbarResource.test_post ____________________________________________ self = client = > @patch.object( FizzbarService, "create", lambda create_request: Fizzbar(**create_request) ) def test_post(self, client: FlaskClient): # noqa with client: payload = dict(name="Test fizzbar", purpose="Test purpose") result = client.post(f"/api/{BASE_ROUTE}/fizzbar/", json=payload).get_json() expected = ( FizzbarSchema() > .dump(Fizzbar(name=payload["name"], purpose=payload["purpose"])) .data ) E AttributeError: 'dict' object has no attribute 'data' app/fizz/fizzbar/controller_test.py:55: AttributeError ___________________________________________ TestFizzbarIdResource.test_put ___________________________________________ self = client = > @patch.object(FizzbarService, "get_by_id", lambda id: make_fizzbar(id=id)) @patch.object(FizzbarService, "update", fake_update) def test_put(self, client: FlaskClient): # noqa with client: result = client.put( f"/api/{BASE_ROUTE}/fizzbar/123", json={"name": "New Fizzbar", "purpose": "New purpose"}, ).get_json() expected = ( FizzbarSchema() .dump( > Fizzbar(fizzbar_id=123, name="New Fizzbar", purpose="New purpose") ) .data ) E AttributeError: 'dict' object has no attribute 'data' app/fizz/fizzbar/controller_test.py:95: AttributeError ______________________________________________ test_FizzbarSchema_works ______________________________________________ schema = def test_FizzbarSchema_works(schema: FizzbarSchema): params: FizzbarInterface = schema.load( > {"fizzbarId": "123", "name": "Test fizzbar", "purpose": "Test purpose"} ).data E AttributeError: 'dict' object has no attribute 'data' app/fizz/fizzbar/schema_test.py:19: AttributeError ____________________________________________ TestFizzbazResource.test_get ____________________________________________ self = client = > @patch.object( FizzbazService, "get_all", lambda: [ make_fizzbaz(123, name="Test Fizzbaz 1"), make_fizzbaz(456, name="Test Fizzbaz 2"), ], ) def test_get(self, client: FlaskClient): # noqa with client: results = client.get( f"/api/{BASE_ROUTE}/fizzbaz", follow_redirects=True ).get_json() expected = ( FizzbazSchema(many=True) .dump( [ make_fizzbaz(123, name="Test Fizzbaz 1"), > make_fizzbaz(456, name="Test Fizzbaz 2"), ] ) .data ) E AttributeError: 'list' object has no attribute 'data' app/fizz/fizzbaz/controller_test.py:37: AttributeError ___________________________________________ TestFizzbazResource.test_post ____________________________________________ self = client = > @patch.object( FizzbazService, "create", lambda create_request: Fizzbaz(**create_request) ) def test_post(self, client: FlaskClient): # noqa with client: payload = dict(name="Test fizzbaz", purpose="Test purpose") result = client.post(f"/api/{BASE_ROUTE}/fizzbaz/", json=payload).get_json() expected = ( FizzbazSchema() > .dump(Fizzbaz(name=payload["name"], purpose=payload["purpose"])) .data ) E AttributeError: 'dict' object has no attribute 'data' app/fizz/fizzbaz/controller_test.py:55: AttributeError ___________________________________________ TestFizzbazIdResource.test_put ___________________________________________ self = client = > @patch.object(FizzbazService, "get_by_id", lambda id: make_fizzbaz(id=id)) @patch.object(FizzbazService, "update", fake_update) def test_put(self, client: FlaskClient): # noqa with client: result = client.put( f"/api/{BASE_ROUTE}/fizzbaz/123", json={"name": "New Fizzbaz", "purpose": "New purpose"}, ).get_json() expected = ( FizzbazSchema() .dump( > Fizzbaz(fizzbaz_id=123, name="New Fizzbaz", purpose="New purpose") ) .data ) E AttributeError: 'dict' object has no attribute 'data' app/fizz/fizzbaz/controller_test.py:95: AttributeError ______________________________________________ test_FizzbazSchema_works ______________________________________________ schema = def test_FizzbazSchema_works(schema: FizzbazSchema): params: FizzbazInterface = schema.load( > {"fizzbazId": "123", "name": "Test fizzbaz", "purpose": "Test purpose"} ).data E AttributeError: 'dict' object has no attribute 'data' app/fizz/fizzbaz/schema_test.py:19: AttributeError ____________________________________________ TestDoodadResource.test_get _____________________________________________ self = client = > @patch.object( DoodadService, "get_all", lambda: [ make_doodad(123, name="Test Doodad 1"), make_doodad(456, name="Test Doodad 2"), ], ) def test_get(self, client: FlaskClient): # noqa with client: results = client.get( f"/api/{BASE_ROUTE}/doodad", follow_redirects=True ).get_json() expected = ( DoodadSchema(many=True) .dump( [ make_doodad(123, name="Test Doodad 1"), > make_doodad(456, name="Test Doodad 2"), ] ) .data ) E AttributeError: 'list' object has no attribute 'data' app/other_api/doodad/controller_test.py:37: AttributeError ____________________________________________ TestDoodadResource.test_post ____________________________________________ self = client = > @patch.object( DoodadService, "create", lambda create_request: Doodad(**create_request) ) def test_post(self, client: FlaskClient): # noqa with client: payload = dict(name="Test doodad", purpose="Test purpose") result = client.post(f"/api/{BASE_ROUTE}/doodad/", json=payload).get_json() expected = ( DoodadSchema() > .dump(Doodad(name=payload["name"], purpose=payload["purpose"])) .data ) E AttributeError: 'dict' object has no attribute 'data' app/other_api/doodad/controller_test.py:55: AttributeError ___________________________________________ TestDoodadIdResource.test_put ____________________________________________ self = client = > @patch.object(DoodadService, "get_by_id", lambda id: make_doodad(id=id)) @patch.object(DoodadService, "update", fake_update) def test_put(self, client: FlaskClient): # noqa with client: result = client.put( f"/api/{BASE_ROUTE}/doodad/123", json={"name": "New Doodad", "purpose": "New purpose"}, ).get_json() expected = ( DoodadSchema() > .dump(Doodad(doodad_id=123, name="New Doodad", purpose="New purpose")) .data ) E AttributeError: 'dict' object has no attribute 'data' app/other_api/doodad/controller_test.py:94: AttributeError ______________________________________________ test_DoodadSchema_works _______________________________________________ schema = def test_DoodadSchema_works(schema: DoodadSchema): params: DoodadInterface = schema.load( > {"doodadId": "123", "name": "Test doodad", "purpose": "Test purpose"} ).data E AttributeError: 'dict' object has no attribute 'data' app/other_api/doodad/schema_test.py:19: AttributeError ____________________________________________ TestWhatsitResource.test_get ____________________________________________ self = client = > @patch.object( WhatsitService, "get_all", lambda: [ make_whatsit(123, name="Test Whatsit 1"), make_whatsit(456, name="Test Whatsit 2"), ], ) def test_get(self, client: FlaskClient): # noqa with client: results = client.get( f"/api/{BASE_ROUTE}/whatsit", follow_redirects=True ).get_json() expected = ( WhatsitSchema(many=True) .dump( [ make_whatsit(123, name="Test Whatsit 1"), > make_whatsit(456, name="Test Whatsit 2"), ] ) .data ) E AttributeError: 'list' object has no attribute 'data' app/other_api/whatsit/controller_test.py:37: AttributeError ___________________________________________ TestWhatsitResource.test_post ____________________________________________ self = client = > @patch.object( WhatsitService, "create", lambda create_request: Whatsit(**create_request) ) def test_post(self, client: FlaskClient): # noqa with client: payload = dict(name="Test whatsit", purpose="Test purpose") result = client.post(f"/api/{BASE_ROUTE}/whatsit/", json=payload).get_json() expected = ( WhatsitSchema() > .dump(Whatsit(name=payload["name"], purpose=payload["purpose"])) .data ) E AttributeError: 'dict' object has no attribute 'data' app/other_api/whatsit/controller_test.py:55: AttributeError ___________________________________________ TestWhatsitIdResource.test_put ___________________________________________ self = client = > @patch.object(WhatsitService, "get_by_id", lambda id: make_whatsit(id=id)) @patch.object(WhatsitService, "update", fake_update) def test_put(self, client: FlaskClient): # noqa with client: result = client.put( f"/api/{BASE_ROUTE}/whatsit/123", json={"name": "New Whatsit", "purpose": "New purpose"}, ).get_json() expected = ( WhatsitSchema() .dump( > Whatsit(whatsit_id=123, name="New Whatsit", purpose="New purpose") ) .data ) E AttributeError: 'dict' object has no attribute 'data' app/other_api/whatsit/controller_test.py:95: AttributeError ______________________________________________ test_WhatsitSchema_works ______________________________________________ schema = def test_WhatsitSchema_works(schema: WhatsitSchema): params: WhatsitInterface = schema.load( > {"whatsitId": "123", "name": "Test whatsit", "purpose": "Test purpose"} ).data E AttributeError: 'dict' object has no attribute 'data' app/other_api/whatsit/schema_test.py:19: AttributeError ____________________________________________ TestWidgetResource.test_get _____________________________________________ self = , client = > @patch.object( WidgetService, "get_all", lambda: [ make_widget(123, name="Test Widget 1"), make_widget(456, name="Test Widget 2"), ], ) def test_get(self, client: FlaskClient): # noqa with client: results = client.get(f"/api/{BASE_ROUTE}", follow_redirects=True).get_json() expected = ( WidgetSchema(many=True) .dump( [ make_widget(123, name="Test Widget 1"), > make_widget(456, name="Test Widget 2"), ] ) .data ) E AttributeError: 'list' object has no attribute 'data' app/widget/controller_test.py:35: AttributeError ____________________________________________ TestWidgetResource.test_post ____________________________________________ self = , client = > @patch.object( WidgetService, "create", lambda create_request: Widget(**create_request) ) def test_post(self, client: FlaskClient): # noqa with client: payload = dict(name="Test widget", purpose="Test purpose") result = client.post(f"/api/{BASE_ROUTE}/", json=payload).get_json() expected = ( WidgetSchema() > .dump(Widget(name=payload["name"], purpose=payload["purpose"])) .data ) E AttributeError: 'dict' object has no attribute 'data' app/widget/controller_test.py:53: AttributeError ___________________________________________ TestWidgetIdResource.test_put ____________________________________________ self = client = > @patch.object(WidgetService, "get_by_id", lambda id: make_widget(id=id)) @patch.object(WidgetService, "update", fake_update) def test_put(self, client: FlaskClient): # noqa with client: result = client.put( f"/api/{BASE_ROUTE}/123", json={"name": "New Widget", "purpose": "New purpose"}, ).get_json() expected = ( WidgetSchema() > .dump(Widget(widget_id=123, name="New Widget", purpose="New purpose")) .data ) E AttributeError: 'dict' object has no attribute 'data' app/widget/controller_test.py:93: AttributeError ______________________________________________ test_WidgetSchema_works _______________________________________________ schema = def test_WidgetSchema_works(schema: WidgetSchema): params: WidgetInterface = schema.load( > {"widgetId": "123", "name": "Test widget", "purpose": "Test purpose"} ).data E AttributeError: 'dict' object has no attribute 'data' app/widget/schema_test.py:19: AttributeError =========================================== 20 failed, 58 passed in 1.22s ============================================