title: dependency_overrides does not override dependency
body: <p>The following FastApi test should use my <code>get_mock_db</code> function instead of the <code>get_db</code> function, but it dosen't. Currently the test fails because it uses the real Database.</p>
  
  <pre class="lang-py prettyprint-override"><code>def get_mock_db():
      example_todo = Todo(title="test title", done=True, id=1)
  
      class MockDb:
          def query(self, _model):
              mock = Mock()
              mock.get = lambda _param: example_todo
  
          def all(self):
              return [example_todo]
  
          def add(self):
              pass
  
          def commit(self):
              pass
  
          def refresh(self, todo: CreateTodo):
              return Todo(title=todo.title, done=todo.done, id=1)
  
      return MockDb()
  
  
  client = TestClient(app)
  
  
  app.dependency_overrides[get_db] = get_mock_db
  
  
  def test_get_all():
      response = client.get("/api/v1/todo")
      assert response.status_code == 200
      assert response.json() == [
          {
              "title": "test title",
              "done": True,
              "id": 1,
          }
      ]
  </code></pre>