You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test test_main_generates_correct_package in tests/main/test_main.py requires manual adding of clients to be tested. This seems to have been forgotten when ClientForwardRefs was added.
I tried to just blindly add it to the fixture but this actually seems to uncover a bug where relative paths aren't resolved properly. With the following diff:
› pytest ./tests/main -k test_main_generates_correct_package -vv
[...]
test_main.py::test_main_generates_correct_package[project_dir14-client_forward_refs-expected_package_path14] FAILED [ 93%]
test_main.py::test_main_generates_correct_package[project_dir15-client_forward_refs_shorter_results-expected_package_path15] FAILED [100%]
[...]
E AssertionError: client.py
E assert 'from typing ...ap_fragment\n' == 'from typing ...ap_fragment\n'
E
E - from typing import TYPE_CHECKING, Any, AsyncIterator, Dict, List, Optional, Union
E ? ---------------
E + from typing import Any, AsyncIterator, Dict, List, Optional, Union
E
E from .async_base_client import AsyncBaseClient
E + from .typing import TYPE_CHECKING...
E
E ...Full output truncated (351 lines hidden), use '-vv' to show
[...]
async def list_strings_1(self, **kwargs: Any) -> Optional[List[Optional[str]]]:
- from .list_strings_1 import ListStrings1
+ from ..list_strings_1 import ListStrings1
? +
[...]
/home/xxx/ariadne-codegen/tests/main/test_main.py:49: AssertionError
The text was updated successfully, but these errors were encountered:
- Add missing tests for `ClientForwardRefsPlugin` with and without
combining with `ShorterResultsPlugin`.
- Fix faulty imports
- Store name and level separate to allow dots specified either on the
module or via level. When importing just lookup what level and name
to use.
- Always use level 0 for `TYPE_CHECKING_MODULE`.
Fixesmirumee#314
The test
test_main_generates_correct_package
intests/main/test_main.py
requires manual adding of clients to be tested. This seems to have been forgotten whenClientForwardRefs
was added.I tried to just blindly add it to the fixture but this actually seems to uncover a bug where relative paths aren't resolved properly. With the following diff:
The result is as follows:
The text was updated successfully, but these errors were encountered: