Instead of RequestTypeError, confirm that it raises BadRequest and TypeError:

```python
with self.app.test_request_context('/?p2=2&p4=4'):
    self.assertRaises(TypeError, f, p4='4')
    self.assertRaises(BadRequest, f, p4='4')
```