Describe the bug
The TestClient.root_path
attribute doesn't seem to apply the given prefix when making test requests.
To Reproduce
Define a TestClient
fixture with an arbitrary root_path
argument and run tests.
Additional context
I defined a client fixture as follows, since the project's top level Router has "/api" as a prefix:
@pytest.fixture()
def client(app: "Starlite") -> "Iterator[TestClient]":
with TestClient(app=app, root_path="/api") as client:
yield client
The prefix was not applied when running tests, however, after manually prefixing a test path with "/api", the resultant call was made to http://testserver.local/api/api/....
(double prefix)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too