typeddjango / django-stubs

PEP-484 stubs for Django
MIT License
1.58k stars 438 forks source link

Unexpected keyword argument "validate_constraints" for "full_clean" of Model #1381

Closed rossmechanic closed 1 year ago

rossmechanic commented 1 year ago

Bug report

What's wrong

When passing validate_constraints=False into the Model.full_clean function, I get a call-arg type error because that argument hasn't yet been added to django-stubs.

error: Unexpected keyword argument "validate_constraints" for "full_clean" of "Model"  [call-arg]
.venv/lib/python3.11/site-packages/django-stubs/db/models/base.pyi:41: note: "full_clean" of "Model" defined here

How is that should be

The validate_constraints keyword arg should be added to the full_clean stub.

System information

lklivingstone commented 1 year ago

Hello, I think I might be able to solve this issue. Can I be assigned?

sobolevn commented 1 year ago

@lklivingstone you don't need to be assigned :) Just pick it up! Thanks!

lklivingstone commented 1 year ago

Sure I will get to it.

lklivingstone commented 1 year ago

I have been getting immediate fails during pytest. I was unsure if the fails were coming due to the changes I made in code, but for trial I cloned the repo and without changing anything in the code also I tried pytest, still im getting these errors.

FAILED tests/test_error_handling.py::test_misconfiguration_handling[missing-section] - AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n'
FAILED tests/test_error_handling.py::test_misconfiguration_handling[missing-settings-module] - assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n'
FAILED tests/test_error_handling.py::test_misconfiguration_handling[no-settings-given] - assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n'
FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[django_settings_module not string] - AssertionError: assert 'usage: \n(co...be a string\n' == 'usage: \n(co...ration file\n'
FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django-stubs section] - AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n'
FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django_settings_module] - assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n'
FAILED tests/test_error_handling.py::test_correct_toml_configuration - SystemExit: 2
FAILED tests/test_error_handling.py::test_correct_configuration - SystemExit: 2
FAILED tests/typecheck/test_config.yml::pyproject_toml_config -
FAILED tests/typecheck/fields/test_related.yml::test_circular_dependency_in_imports_with_foreign_key -
FAILED tests/typecheck/fields/test_related.yml::test_circular_dependency_in_imports_with_string_based -
FAILED tests/typecheck/fields/test_related.yml::fail_if_no_model_in_the_same_app_models_init_py -
FAILED tests/typecheck/fields/test_related.yml::foreign_key_relationship_for_models_with_custom_manager_unsolvable -
FAILED tests/typecheck/fields/test_related.yml::test_fails_if_app_label_is_unknown_in_relation_field -
FAILED tests/typecheck/managers/test_managers.yml::test_model_objects_attribute_present_in_case_of_model_cls_passed_as_generic_parameter -
FAILED tests/typecheck/managers/test_managers.yml::test_base_manager_called_on_model_cls_as_generic_parameter -

FAILED tests/typecheck/managers/test_managers.yml::override_manager_create1 -
FAILED tests/typecheck/managers/test_managers.yml::test_emits_error_for_unresolved_managers -
FAILED tests/typecheck/managers/test_managers.yml::subclass_manager_without_type_parameters_disallow_any_generics -
FAILED tests/typecheck/models/test_abstract.yml::test_fetch_pk_with_custom_manager_on_abstract_model -
FAILED tests/typecheck/models/test_inheritance.yml::django_contrib_gis_base_model_mixin_inheritance -
FAILED tests/typecheck/models/test_primary_key.yml::test_access_to_id_field_through_self_if_no_primary_key_defined -
FAILED tests/typecheck/models/test_primary_key.yml::test_access_to_id_field_through_self_if_primary_key_is_defined -
FAILED tests/typecheck/models/test_primary_key.yml::test_access_to_id_field_through_self_if_primary_key_has_different_name -

Result of the test:

24 failed, 330 passed in 4540.98s (1:15:40)

There were no errors during pre-commit.

RyanWalker277 commented 1 year ago

I also experienced a similar issue where some tests were failing by default. You may want to consider clearing your current pytest cache as recommended in the documentation here. Additionally, it would be helpful if you could provide a detailed traceback of the failure. This will allow us to investigate whether the issue may be related to a misconfiguration at your local end.

intgr commented 1 year ago

Make sure you have the correct dependency versions: pip install -r requirements.txt

lklivingstone commented 1 year ago

I have made sure to clear the cache and installed everything from requirements.txt I followed the CONTRIBUTING.md file for every step.

I recieved the following result from the pytest:

Collapsed full test output ``` ============================================ test session starts ============================================ platform win32 -- Python 3.9.0, pytest-7.2.1, pluggy-1.0.0 -- D:\typedjango\env\Scripts\python.exe cachedir: .pytest_cache rootdir: D:\typedjango\django-stubs, configfile: pytest.ini, testpaths: ./tests, ./django_stubs_ext/tests plugins: mypy-plugins-1.10.1 collected 354 items tests/test_error_handling.py::test_misconfiguration_handling[missing-section] FAILED tests/test_error_handling.py::test_misconfiguration_handling[missing-settings-module] FAILED tests/test_error_handling.py::test_misconfiguration_handling[no-settings-given] FAILED tests/test_error_handling.py::test_handles_filename[not matching an existing file] PASSED tests/test_error_handling.py::test_handles_filename[as empty string] PASSED tests/test_error_handling.py::test_handles_filename[as none] PASSED tests/test_error_handling.py::test_toml_misconfiguration_handling[django_settings_module not string] FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django-stubs section] FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django_settings_module] FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[invalid toml] PASSED tests/test_error_handling.py::test_correct_toml_configuration usage: (config) ... [tool.django-stubs] django_settings_module = str (required) ... (django-stubs) mypy: error: could not load configuration file FAILED tests/test_error_handling.py::test_correct_configuration usage: (config) ... [mypy.plugins.django_stubs] django_settings_module: str (required) ... (django-stubs) mypy: error: could not load configuration file FAILED tests/typecheck/test_annotated.yml::annotated_should_not_iterfere PASSED tests/typecheck/test_config.yml::pyproject_toml_config ================================================= FAILURES ================================================== ______________________________ test_misconfiguration_handling[missing-section] ______________________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 65, in test_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n' usage: (config) ... [mypy.plugins.django_stubs] django_settings_module: str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show __________________________ test_misconfiguration_handling[missing-settings-module] __________________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 65, in test_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' usage: (config) ... [mypy.plugins.django_stubs] django_settings_module: str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show _____________________________ test_misconfiguration_handling[no-settings-given] _____________________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 65, in test_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' usage: (config) ... [mypy.plugins.django_stubs] django_settings_module: str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show __________________ test_toml_misconfiguration_handling[django_settings_module not string] ___________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 124, in test_toml_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert 'usage: \n(co...be a string\n' == 'usage: \n(co...ration file\n' usage: (config) ... [tool.django-stubs] django_settings_module = str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show _____________________ test_toml_misconfiguration_handling[missing django-stubs section] _____________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 124, in test_toml_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n' usage: (config) ... [tool.django-stubs] django_settings_module = str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show ____________________ test_toml_misconfiguration_handling[missing django_settings_module] ____________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 124, in test_toml_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' usage: (config) ... [tool.django-stubs] django_settings_module = str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show ______________________________________ test_correct_toml_configuration ______________________________________ Traceback (most recent call last): File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 66, in parse_toml_file with filepath.open(mode="rb") as f: File "c:\users\livin\appdata\local\programs\python\python39-32\lib\pathlib.py", line 1241, in open return io.open(self, mode, buffering, encoding, errors, newline, File "c:\users\livin\appdata\local\programs\python\python39-32\lib\pathlib.py", line 1109, in _opener return self._accessor.open(self, flags, mode) PermissionError: [Errno 13] Permission denied: 'C:\\Users\\livin\\AppData\\Local\\Temp\\tmpc3t0ocj3.toml' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 135, in test_correct_toml_configuration config = DjangoPluginConfig(filename) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 59, in __init__ self.parse_toml_file(filepath) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 69, in parse_toml_file toml_exit(COULD_NOT_LOAD_FILE) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 43, in exit_with_error handler.error(msg) File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 388, in error self.exit(2, gettext("%(prog)s: error: %(message)s\n") % args) File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 375, in exit sys.exit(status) SystemExit: 2 ________________________________________ test_correct_configuration _________________________________________ Traceback (most recent call last): File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 86, in parse_ini_file with filepath.open(encoding="utf-8") as f: File "c:\users\livin\appdata\local\programs\python\python39-32\lib\pathlib.py", line 1241, in open return io.open(self, mode, buffering, encoding, errors, newline, File "c:\users\livin\appdata\local\programs\python\python39-32\lib\pathlib.py", line 1109, in _opener return self._accessor.open(self, flags, mode) PermissionError: [Errno 13] Permission denied: 'C:\\Users\\livin\\AppData\\Local\\Temp\\tmp6jfl44vh' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 150, in test_correct_configuration config = DjangoPluginConfig(filename) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 61, in __init__ self.parse_ini_file(filepath) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 89, in parse_ini_file exit_with_error(COULD_NOT_LOAD_FILE) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 43, in exit_with_error handler.error(msg) File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 388, in error self.exit(2, gettext("%(prog)s: error: %(message)s\n") % args) File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 375, in exit sys.exit(status) SystemExit: 2 ========================================== short test summary info ========================================== FAILED tests/test_error_handling.py::test_misconfiguration_handling[missing-section] - AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_misconfiguration_handling[missing-settings-module] - assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_misconfiguration_handling[no-settings-given] - assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[django_settings_module not string] - AssertionError: assert 'usage: \n(co...be a string\n' == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django-stubs section] - AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django_settings_module] - assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_correct_toml_configuration - SystemExit: 2 FAILED tests/test_error_handling.py::test_correct_configuration - SystemExit: 2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! c:\users\livin\appdata\local\programs\python\python39-32\lib\threading.py:1045: KeyboardInterrupt (to show a full traceback on KeyboardInterrupt use --full-trace) ======================================= 8 failed, 5 passed in 11.58s ======================================== (env) D:\typedjango\django-stubs>pytest ============================================ test session starts ============================================ platform win32 -- Python 3.9.0, pytest-7.2.1, pluggy-1.0.0 -- D:\typedjango\env\Scripts\python.exe cachedir: .pytest_cache rootdir: D:\typedjango\django-stubs, configfile: pytest.ini, testpaths: ./tests, ./django_stubs_ext/tests plugins: mypy-plugins-1.10.1 collected 354 items tests/test_error_handling.py::test_misconfiguration_handling[missing-section] FAILED tests/test_error_handling.py::test_misconfiguration_handling[missing-settings-module] FAILED tests/test_error_handling.py::test_misconfiguration_handling[no-settings-given] FAILED tests/test_error_handling.py::test_handles_filename[not matching an existing file] PASSED tests/test_error_handling.py::test_handles_filename[as empty string] PASSED tests/test_error_handling.py::test_handles_filename[as none] PASSED tests/test_error_handling.py::test_toml_misconfiguration_handling[django_settings_module not string] FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django-stubs section] FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django_settings_module] FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[invalid toml] PASSED tests/test_error_handling.py::test_correct_toml_configuration usage: (config) ... [tool.django-stubs] django_settings_module = str (required) ... (django-stubs) mypy: error: could not load configuration file FAILED tests/test_error_handling.py::test_correct_configuration usage: (config) ... [mypy.plugins.django_stubs] django_settings_module: str (required) ... (django-stubs) mypy: error: could not load configuration file FAILED tests/typecheck/test_annotated.yml::annotated_should_not_iterfere PASSED tests/typecheck/test_config.yml::pyproject_toml_config FAILED tests/typecheck/test_config.yml::generate_pyproject_toml_and_settings_file_from_installed_apps_key PASSED tests/typecheck/test_config.yml::add_mypy_path_to_package_search PASSED tests/typecheck/test_config.yml::add_mypypath_env_var_to_package_search PASSED tests/typecheck/test_forms.yml::no_incompatible_meta_nested_class_false_positive PASSED tests/typecheck/test_forms.yml::formview_methods_on_forms_return_proper_types PASSED tests/typecheck/test_forms.yml::updateview_form_valid_has_form_save PASSED tests/typecheck/test_forms.yml::successmessagemixin_compatible_with_formmixin PASSED tests/typecheck/test_formsets.yml::inlineformset_factory PASSED tests/typecheck/test_helpers.yml::transaction_atomic_contextmanager PASSED tests/typecheck/test_helpers.yml::transaction_atomic_decorator PASSED tests/typecheck/test_helpers.yml::mark_safe_decorator_and_function PASSED tests/typecheck/test_import_all.yml::import_all_modules PASSED tests/typecheck/test_mail.yml::check_email_message_attach PASSED tests/typecheck/test_request.yml::request_object_has_user_of_type_auth_user_model PASSED tests/typecheck/test_request.yml::request_object_user_can_be_descriminated PASSED tests/typecheck/test_request.yml::request_object_user_without_auth_and_contenttypes_apps PASSED tests/typecheck/test_request.yml::request_object_user_without_auth_but_with_contenttypes_apps PASSED tests/typecheck/test_request.yml::subclass_request_not_changed_user_type PASSED tests/typecheck/test_request.yml::subclass_request_changed_user_type PASSED tests/typecheck/test_request.yml::request_get_post PASSED tests/typecheck/test_request.yml::request_get_post_unreachable PASSED tests/typecheck/test_settings.yml::settings_loaded_from_different_files PASSED tests/typecheck/test_settings.yml::global_settings_are_always_loaded PASSED tests/typecheck/test_settings.yml::fail_if_there_is_no_setting PASSED tests/typecheck/test_settings.yml::override_default_setting_with_different_type_in_the_different_module PASSEDtests/typecheck/test_settings.yml::settings_hasattr PASSED tests/typecheck/test_shortcuts.yml::get_object_or_404_returns_proper_types PASSED tests/typecheck/test_shortcuts.yml::get_user_model_returns_proper_class PASSED tests/typecheck/test_shortcuts.yml::check_render_function_arguments_annotations PASSED tests/typecheck/test_shortcuts.yml::check_redirect_return_annotation PASSED tests/typecheck/contrib/admin/test_decorators.yml::test_admin_decorators_display PASSED tests/typecheck/contrib/admin/test_decorators.yml::test_admin_decorators_action PASSED tests/typecheck/contrib/admin/test_options.yml::test_full_admin PASSED tests/typecheck/contrib/admin/test_options.yml::test_fieldset_workaround_regression PASSED tests/typecheck/contrib/admin/test_options.yml::errors_on_omitting_fields_from_fieldset_opts PASSED tests/typecheck/contrib/admin/test_options.yml::errors_on_invalid_radio_fields PASSED tests/typecheck/contrib/admin/test_options.yml::errors_for_invalid_formfield_overrides PASSED tests/typecheck/contrib/admin/test_options.yml::errors_for_invalid_action_signature PASSED tests/typecheck/contrib/admin/test_options.yml::errors_for_invalid_model_admin_generic PASSED tests/typecheck/contrib/auth/test_decorators.yml::login_required_bare PASSED tests/typecheck/contrib/auth/test_decorators.yml::login_required_fancy PASSED tests/typecheck/contrib/auth/test_decorators.yml::login_required_weird PASSED tests/typecheck/contrib/auth/test_decorators.yml::login_required_incorrect_return PASSED tests/typecheck/contrib/auth/test_decorators.yml::user_passes_test PASSED tests/typecheck/contrib/auth/test_decorators.yml::user_passes_test_bare_is_error PASSED tests/typecheck/contrib/auth/test_decorators.yml::permission_required PASSED tests/typecheck/contrib/auth/test_misc.yml::test_request_session PASSED tests/typecheck/contrib/auth/test_misc.yml::test_client_session PASSED tests/typecheck/contrib/auth/test_misc.yml::test_user_fields PASSED tests/typecheck/contrib/postgres/test_fields.yml::union_combinable_reduced_to_non_union PASSED tests/typecheck/contrib/postgres/test_fields.yml::postgres_forms_simple_array_field PASSED tests/typecheck/contrib/postgres/test_indexes.yml::can_instantiate_index[index=BrinIndex] PASSED tests/typecheck/contrib/postgres/test_indexes.yml::can_instantiate_index[index=BTreeIndex] PASSED tests/typecheck/contrib/postgres/test_indexes.yml::can_instantiate_index[index=GinIndex] PASSED tests/typecheck/contrib/postgres/test_indexes.yml::can_instantiate_index[index=GistIndex] PASSED tests/typecheck/contrib/postgres/test_indexes.yml::can_instantiate_index[index=HashIndex] PASSED tests/typecheck/contrib/postgres/test_indexes.yml::can_instantiate_index[index=SpGistIndex] PASSED tests/typecheck/contrib/postgres/test_indexes.yml::can_instantiate_opclass PASSED tests/typecheck/contrib/sitemaps/test_generic_sitemap.yml::test_items_custom_model PASSED tests/typecheck/contrib/sitemaps/test_generic_sitemap.yml::test_items_string_sequence PASSED tests/typecheck/contrib/staticfiles/test_finders.yml::test_find_one PASSED tests/typecheck/contrib/staticfiles/test_finders.yml::test_find_all PASSED tests/typecheck/contrib/staticfiles/test_finders.yml::test_file_system_finder PASSED tests/typecheck/contrib/staticfiles/test_finders.yml::test_app_directories_finder PASSED tests/typecheck/core/test_checks.yml::test_checks_register PASSED tests/typecheck/core/test_exceptions.yml::ValidationError_nested_message PASSED tests/typecheck/db/test_connection.yml::raw_default_connection PASSED tests/typecheck/db/test_connection.yml::raw_connection_psycopg2_composable PASSED tests/typecheck/db/test_connection.yml::raw_connections PASSED tests/typecheck/db/test_transaction.yml::atomic_bare PASSED tests/typecheck/db/test_transaction.yml::atomic_args PASSED tests/typecheck/db/test_transaction.yml::non_atomic_requests_bare PASSED tests/typecheck/db/test_transaction.yml::non_atomic_requests_args PASSED tests/typecheck/db/migrations/test_operations.yml::runsql_sqls_variants PASSED tests/typecheck/db/models/test_constraints.yml::unique_constraint_expressions PASSED tests/typecheck/db/models/test_constraints.yml::unique_constraint_fields PASSED tests/typecheck/db/models/test_constraints.yml::unique_constraint_expressions_fields PASSED tests/typecheck/db/models/test_init.yml::field_to_many_and_to_one_attrs_bool_or_none_in_field_base_class PASSED tests/typecheck/db/models/test_query.yml::django_db_models_query_module_has_ModelIterable PASSED tests/typecheck/db/models/test_query.yml::django_db_models_query_module_has_ValuesListIterable PASSED tests/typecheck/db/models/test_query.yml::django_db_models_query_module_has_NamedValuesListIterable PASSED tests/typecheck/db/models/test_query.yml::QuerySet_has__iterable_class_defined PASSED tests/typecheck/fields/test_base.yml::test_model_fields_classes_present_as_primitives PASSED tests/typecheck/fields/test_base.yml::test_model_field_classes_from_existing_locations PASSED tests/typecheck/fields/test_base.yml::test_add_id_field_if_no_primary_key_defined PASSED tests/typecheck/fields/test_base.yml::test_do_not_add_id_if_field_with_primary_key_True_defined PASSED tests/typecheck/fields/test_base.yml::blank_and_null_char_field_allows_none PASSED tests/typecheck/fields/test_base.yml::blank_and_not_null_charfield_does_not_allow_none PASSED tests/typecheck/fields/test_base.yml::if_field_called_on_class_return_field_itself PASSED tests/typecheck/fields/test_base.yml::fields_on_non_model_classes_resolve_to_field_type PASSED tests/typecheck/fields/test_base.yml::fields_inside_mixins_used_in_model_subclasses_resolved_as_primitives PASSED tests/typecheck/fields/test_base.yml::can_narrow_field_type PASSED tests/typecheck/fields/test_base.yml::test_binary_field_return_types PASSED tests/typecheck/fields/test_base.yml::test_small_auto_field_class_presents_as_int PASSED tests/typecheck/fields/test_base.yml::test_ignores_renamed_field PASSED tests/typecheck/fields/test_generic_foreign_key.yml::generic_foreign_key_could_point_to_any_model_and_is_always_optional PASSED tests/typecheck/fields/test_generic_foreign_key.yml::generic_foreign_key_subclass_could_point_to_any_model_and_is_always_optional PASSED tests/typecheck/fields/test_nullable.yml::autofield_can_be_set_to_none PASSED tests/typecheck/fields/test_nullable.yml::nullable_field_with_strict_optional_true PASSED tests/typecheck/fields/test_nullable.yml::nullable_array_field PASSED tests/typecheck/fields/test_nullable.yml::nullable_foreign_key PASSED tests/typecheck/fields/test_nullable.yml::nullable_self_foreign_key PASSED tests/typecheck/fields/test_postgres_fields.yml::array_field_descriptor_access PASSED tests/typecheck/fields/test_postgres_fields.yml::array_field_base_field_parsed_into_generic_typevar PASSED tests/typecheck/fields/test_related.yml::test_foreign_key_field_with_related_name PASSED tests/typecheck/fields/test_related.yml::foreign_key_field_creates_attribute_with_underscore_id PASSED tests/typecheck/fields/test_related.yml::foreign_key_field_custom_to_field PASSED tests/typecheck/fields/test_related.yml::foreign_key_field_different_order_of_params PASSED tests/typecheck/fields/test_related.yml::to_parameter_as_string_with_application_name__model_imported PASSED tests/typecheck/fields/test_related.yml::one_to_one_field_no_related_name PASSED tests/typecheck/fields/test_related.yml::test_circular_dependency_in_imports_with_foreign_key FAILED tests/typecheck/fields/test_related.yml::test_circular_dependency_in_imports_with_string_based FAILED tests/typecheck/fields/test_related.yml::models_related_managers_work_with_direct_model_inheritance_and_with_inheritance_from_other_model PASSED tests/typecheck/fields/test_related.yml::models_imported_inside_init_file_foreign_key PASSED tests/typecheck/fields/test_related.yml::models_imported_inside_init_file_one_to_one_field PASSED tests/typecheck/fields/test_related.yml::models_triple_circular_reference PASSED tests/typecheck/fields/test_related.yml::many_to_many_field_converts_to_queryset_of_model_type PASSED tests/typecheck/fields/test_related.yml::many_to_many_works_with_string_if_imported PASSED tests/typecheck/fields/test_related.yml::foreign_key_with_self PASSED tests/typecheck/fields/test_related.yml::many_to_many_with_self PASSED tests/typecheck/fields/test_related.yml::recursively_checking_for_base_model_in_to_parameter PASSED tests/typecheck/fields/test_related.yml::if_no_related_name_is_passed_create_default_related_managers PASSED tests/typecheck/fields/test_related.yml::underscore_id_attribute_has_set_type_of_primary_key_if_explicit PASSED tests/typecheck/fields/test_related.yml::if_model_is_defined_as_name_of_the_class_look_for_it_in_the_same_app PASSED tests/typecheck/fields/test_related.yml::fail_if_no_model_in_the_same_app_models_init_py FAILED tests/typecheck/fields/test_related.yml::test_foreign_key_field_without_backwards_relation PASSED tests/typecheck/fields/test_related.yml::to_parameter_could_be_resolved_if_passed_from_settings PASSED tests/typecheck/fields/test_related.yml::foreign_key_with_custom_app_name PASSED tests/typecheck/fields/test_related.yml::related_field_to_extracted_from_function PASSED tests/typecheck/fields/test_related.yml::related_manager_name_defined_by_pattern PASSED tests/typecheck/fields/test_related.yml::test_related_fields_returned_as_descriptors_from_model_class PASSED tests/typecheck/fields/test_related.yml::test_foreign_key_from_superclass_inherits_correctly PASSED tests/typecheck/fields/test_related.yml::test_foreign_key_from_superclass_inherits_correctly_when_also_inheriting_manager PASSED tests/typecheck/fields/test_related.yml::foreign_key_relationship_for_models_with_custom_manager PASSED tests/typecheck/fields/test_related.yml::foreign_key_relationship_for_models_with_custom_manager_unsolvable FAILED tests/typecheck/fields/test_related.yml::resolve_primary_keys_for_foreign_keys_with_abstract_self_model PASSED tests/typecheck/fields/test_related.yml::related_manager_is_a_subclass_of_default_manager PASSED tests/typecheck/fields/test_related.yml::related_manager_shared_between_multiple_relations PASSED tests/typecheck/fields/test_related.yml::explicitly_declared_related_manager_is_not_overridden PASSED tests/typecheck/fields/test_related.yml::related_manager_no_conflict_from_star_import PASSED tests/typecheck/fields/test_related.yml::many_to_many_field_can_be_used_in_alias PASSED tests/typecheck/fields/test_related.yml::callable_reverse_manager PASSED tests/typecheck/fields/test_related.yml::test_fails_if_app_label_is_unknown_in_relation_field FAILED tests/typecheck/managers/test_managers.yml::test_every_model_has_objects_queryset_available PASSED tests/typecheck/managers/test_managers.yml::every_model_has_its_own_objects_queryset PASSED tests/typecheck/managers/test_managers.yml::test_model_objects_attribute_present_in_case_of_model_cls_passed_as_generic_parameter FAILED tests/typecheck/managers/test_managers.yml::test_base_manager_called_on_model_cls_as_generic_parameter FAILED tests/typecheck/managers/test_managers.yml::if_custom_manager_defined_it_is_set_to_default_manager PASSED tests/typecheck/managers/test_managers.yml::if_default_manager_name_is_passed_set_default_manager_to_it PASSED tests/typecheck/managers/test_managers.yml::test_leave_as_is_if_objects_is_set_and_fill_typevars_with_outer_class PASSED tests/typecheck/managers/test_managers.yml::model_imported_from_different_file PASSED tests/typecheck/managers/test_managers.yml::managers_that_defined_on_other_models_do_not_influence PASSED tests/typecheck/managers/test_managers.yml::managers_inherited_from_abstract_classes_multiple_inheritance PASSED tests/typecheck/managers/test_managers.yml::model_has_a_manager_of_the_same_type PASSED tests/typecheck/managers/test_managers.yml::manager_without_annotation_of_the_model_gets_it_from_outer_one PASSED tests/typecheck/managers/test_managers.yml::inherited_manager_has_the_proper_type_of_model PASSED tests/typecheck/managers/test_managers.yml::inheritance_with_explicit_type_on_child_manager PASSED tests/typecheck/managers/test_managers.yml::custom_manager_returns_proper_model_types PASSED tests/typecheck/managers/test_managers.yml::custom_manager_annotate_method_before_type_declaration PASSED tests/typecheck/managers/test_managers.yml::override_manager_create1 FAILED tests/typecheck/managers/test_managers.yml::override_manager_create2 PASSED tests/typecheck/managers/test_managers.yml::regression_manager_scope_foreign PASSED tests/typecheck/managers/test_managers.yml::test_emits_error_for_unresolved_managers FAILED tests/typecheck/managers/test_managers.yml::subclass_manager_without_type_parameters PASSED tests/typecheck/managers/test_managers.yml::subclass_manager_without_type_parameters_disallow_any_generics FAILED tests/typecheck/managers/querysets/test_annotate.yml::annotate_using_with_annotations PASSED tests/typecheck/managers/querysets/test_annotate.yml::annotate_using_with_annotations_typeddict PASSED tests/typecheck/managers/querysets/test_annotate.yml::annotate_using_with_annotations_typeddict_subtypes PASSED tests/typecheck/managers/querysets/test_annotate.yml::annotate_basic PASSED tests/typecheck/managers/querysets/test_annotate.yml::annotate_no_field_name PASSED tests/typecheck/managers/querysets/test_annotate.yml::annotate_model_usage_across_methods PASSED tests/typecheck/managers/querysets/test_annotate.yml::annotate_twice_works PASSED tests/typecheck/managers/querysets/test_annotate.yml::annotate_using_queryset_across_methods PASSED tests/typecheck/managers/querysets/test_annotate.yml::annotate_currently_allows_lookups_of_non_existent_field PASSED tests/typecheck/managers/querysets/test_annotate.yml::annotate_values_or_values_list_before_or_after_annotate_broadens_type PASSED tests/typecheck/managers/querysets/test_as_manager.yml::declares_manager_type_like_django PASSED tests/typecheck/managers/querysets/test_as_manager.yml::includes_django_methods_returning_queryset PASSED tests/typecheck/managers/querysets/test_as_manager.yml::model_gets_generated_manager_as_default_manager PASSED tests/typecheck/managers/querysets/test_as_manager.yml::resolves_name_collision_with_other_module_level_object PASSED tests/typecheck/managers/querysets/test_as_manager.yml::includes_custom_queryset_methods PASSED tests/typecheck/managers/querysets/test_as_manager.yml::handles_call_outside_of_model_class_definition PASSED tests/typecheck/managers/querysets/test_as_manager.yml::handles_name_collision_when_declared_outside_of_model_class_body PASSED tests/typecheck/managers/querysets/test_as_manager.yml::reuses_generated_type_when_called_identically_for_multiple_managers PASSED tests/typecheck/managers/querysets/test_as_manager.yml::generates_new_manager_class_when_name_colliding_with_explicit_manager PASSED tests/typecheck/managers/querysets/test_as_manager.yml::handles_type_collision_with_from_queryset PASSED tests/typecheck/managers/querysets/test_basic_methods.yml::queryset_basic_methods_return_type PASSED tests/typecheck/managers/querysets/test_basic_methods.yml::queryset_missing_method PASSED tests/typecheck/managers/querysets/test_filter.yml::filtering_with_proper_types PASSED tests/typecheck/managers/querysets/test_filter.yml::no_such_field_for_filter PASSED tests/typecheck/managers/querysets/test_filter.yml::filter_with_invalid_type PASSED tests/typecheck/managers/querysets/test_filter.yml::filter_with_multiple_fields PASSED tests/typecheck/managers/querysets/test_filter.yml::valid_filter_with_lookup PASSED tests/typecheck/managers/querysets/test_filter.yml::invalid_filter_with_lookup PASSED tests/typecheck/managers/querysets/test_filter.yml::strings_are_allowed_for_exact_for_dates PASSED tests/typecheck/managers/querysets/test_filter.yml::related_model_foreign_key_lookups PASSED tests/typecheck/managers/querysets/test_filter.yml::related_model_reverse_foreign_key_lookup PASSED tests/typecheck/managers/querysets/test_filter.yml::many_to_many_lookups PASSED tests/typecheck/managers/querysets/test_filter.yml::one_to_one_lookups PASSED tests/typecheck/managers/querysets/test_filter.yml::f_expression_simple_case PASSED tests/typecheck/managers/querysets/test_filter.yml::f_expression_with_expression_math_is_not_supported PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_with_base_manager PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_queryset_imported_from_other_module PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_generated_manager_imported_from_other_module PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_annotates_manager_variable_as_type PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_with_manager PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_returns_intersection_of_manager_and_queryset PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_with_class_name_provided PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_with_class_inheritance PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_with_manager_in_another_directory_and_imports PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_with_inherited_manager_and_typing_no_return PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_with_decorated_queryset_methods PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_model_gets_generated_manager_as_default_manager PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_can_resolve_explicit_any_methods PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::test_queryset_in_model_class_body PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::test_queryset_in_model_class_body_subclass PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_includes_methods_returning_queryset PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::from_queryset_custom_auth_user_model PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::reuses_type_when_called_twice_identically PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::handles_name_collision_with_generated_type PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::resolves_name_collision_with_other_module_level_object PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::accepts_explicit_none_as_class_name PASSED tests/typecheck/managers/querysets/test_from_queryset.yml::uses_fallback_class_name_when_argument_is_not_string_expression PASSED tests/typecheck/managers/querysets/test_iteration.yml::sync_for PASSED tests/typecheck/managers/querysets/test_iteration.yml::async_for PASSED tests/typecheck/managers/querysets/test_querysetany.yml::queryset_isinstance_check PASSED tests/typecheck/managers/querysets/test_querysetany.yml::queryset_list PASSED tests/typecheck/managers/querysets/test_union_type.yml::union_queryset_custom_method PASSED tests/typecheck/managers/querysets/test_values.yml::queryset_values_method_returns_typeddict PASSED tests/typecheck/managers/querysets/test_values.yml::queryset_values_all_values PASSED tests/typecheck/managers/querysets/test_values.yml::queryset_foreign_key_object_always_a_primary_key PASSED tests/typecheck/managers/querysets/test_values.yml::values_with_related_model_fields PASSED tests/typecheck/managers/querysets/test_values.yml::select_all_related_model_values_for_every_current_value PASSED tests/typecheck/managers/querysets/test_values.yml::values_of_many_to_many_field PASSED tests/typecheck/managers/querysets/test_values.yml::queryset_values_blank_charfield PASSED tests/typecheck/managers/querysets/test_values_list.yml::values_list_simple_field_returns_queryset_of_tuples PASSED tests/typecheck/managers/querysets/test_values_list.yml::values_list_supports_queryset_methods PASSED tests/typecheck/managers/querysets/test_values_list.yml::values_list_related_model_fields PASSED tests/typecheck/managers/querysets/test_values_list.yml::values_list_flat_true_methods PASSED tests/typecheck/managers/querysets/test_values_list.yml::values_list_named_true PASSED tests/typecheck/managers/querysets/test_values_list.yml::values_list_flat_true_named_true_error PASSED tests/typecheck/managers/querysets/test_values_list.yml::invalid_lookups PASSED tests/typecheck/managers/querysets/test_values_list.yml::named_true_with_related_model_fields PASSED tests/typecheck/managers/querysets/test_values_list.yml::values_list_flat_true_with_ids PASSED tests/typecheck/managers/querysets/test_values_list.yml::subclass_of_queryset_has_proper_typings_on_methods PASSED tests/typecheck/managers/querysets/test_values_list.yml::values_list_of_many_to_many_field PASSED tests/typecheck/managers/querysets/test_values_list.yml::queryset_values_list_blank_charfield PASSED tests/typecheck/models/test_abstract.yml::test_filter_on_abstract_user_pk PASSED tests/typecheck/models/test_abstract.yml::test_fetch_pk_with_custom_manager_on_abstract_model FAILED tests/typecheck/models/test_contrib_models.yml::contrib_auth_model_fields PASSED tests/typecheck/models/test_create.yml::default_manager_create_is_typechecked PASSED tests/typecheck/models/test_create.yml::model_recognises_parent_attributes PASSED tests/typecheck/models/test_create.yml::deep_multiple_inheritance_with_create PASSED tests/typecheck/models/test_create.yml::optional_id_fields_for_create_is_error_if_not_autofield PASSED tests/typecheck/models/test_create.yml::none_for_primary_key_is_allowed_if_field_is_autogenerated PASSED tests/typecheck/models/test_create.yml::when_default_for_primary_key_is_specified_allow_none_to_be_set PASSED tests/typecheck/models/test_extra_methods.yml::if_field_has_choices_set_model_has_get_FIELDNAME_display_method PASSED tests/typecheck/models/test_extra_methods.yml::date_datetime_fields_have_get_next_by_get_previous_by PASSED tests/typecheck/models/test_extra_methods.yml::get_next_by_get_previous_by_absent_if_null_true PASSED tests/typecheck/models/test_indexes.yml::model_index PASSED tests/typecheck/models/test_inheritance.yml::test_meta_nested_class_allows_subclassing_in_multiple_inheritance PASSED tests/typecheck/models/test_inheritance.yml::test_inheritance_from_abstract_model_does_not_fail_if_field_with_id_exists PASSED tests/typecheck/models/test_inheritance.yml::test_typechecking_for_model_subclasses PASSED tests/typecheck/models/test_inheritance.yml::fail_if_no_such_attribute_on_model PASSED tests/typecheck/models/test_inheritance.yml::fields_recognized_if_base_model_is_subclass_of_models_model PASSED tests/typecheck/models/test_inheritance.yml::django_contrib_gis_base_model_mixin_inheritance FAILED tests/typecheck/models/test_init.yml::arguments_to_init_unexpected_attributes PASSED tests/typecheck/models/test_init.yml::plain_function_which_returns_model PASSED tests/typecheck/models/test_init.yml::arguments_to_init_from_class_incompatible_type PASSED tests/typecheck/models/test_init.yml::arguments_to_init_combined_from_base_classes PASSED tests/typecheck/models/test_init.yml::fields_from_abstract_user_propagate_to_init PASSED tests/typecheck/models/test_init.yml::pk_refers_to_primary_key_and_could_be_passed_to_init PASSED tests/typecheck/models/test_init.yml::typechecking_of_pk PASSED tests/typecheck/models/test_init.yml::set_foreign_key_by_its_primary_key PASSED tests/typecheck/models/test_init.yml::setting_value_to_an_array_of_ints PASSED tests/typecheck/models/test_init.yml::if_no_explicit_primary_key_id_can_be_passed PASSED tests/typecheck/models/test_init.yml::arguments_can_be_passed_as_positionals PASSED tests/typecheck/models/test_init.yml::charfield_with_integer_choices PASSED tests/typecheck/models/test_init.yml::optional_id_fields_allowed_in_init PASSED tests/typecheck/models/test_init.yml::init_in_abstract_model_classmethod_should_not_throw_error_for_valid_fields PASSED tests/typecheck/models/test_init.yml::field_set_type_honors_type_redefinition PASSED tests/typecheck/models/test_meta_options.yml::meta_attribute_has_a_type_of_current_model PASSED tests/typecheck/models/test_meta_options.yml::get_field_returns_proper_field_type PASSED tests/typecheck/models/test_meta_options.yml::get_field_with_abstract_inheritance PASSED tests/typecheck/models/test_primary_key.yml::test_access_to_id_field_through_self_if_no_primary_key_defined FAILED tests/typecheck/models/test_primary_key.yml::test_access_to_id_field_through_self_if_primary_key_is_defined FAILED tests/typecheck/models/test_primary_key.yml::test_access_to_id_field_through_self_if_primary_key_has_different_name FAILED tests/typecheck/models/test_proxy_models.yml::foreign_key_to_proxy_model_accepts_first_non_proxy_model PASSED tests/typecheck/models/test_related_fields.yml::test_related_name_custom_manager PASSED tests/typecheck/models/test_state.yml::state_attribute_has_a_type_of_model_state PASSED tests/typecheck/template/test_library.yml::register_filter_unnamed PASSED tests/typecheck/template/test_library.yml::register_filter_named PASSED tests/typecheck/template/test_library.yml::register_simple_tag_no_args PASSED tests/typecheck/template/test_library.yml::register_simple_tag_context PASSED tests/typecheck/template/test_library.yml::register_simple_tag_named PASSED tests/typecheck/template/test_library.yml::register_tag_no_args PASSED tests/typecheck/template/test_library.yml::register_tag_named PASSED tests/typecheck/template/test_library.yml::register_inclusion_tag PASSED tests/typecheck/test/test_client.yml::client_methods PASSED tests/typecheck/test/test_client.yml::async_client_methods PASSED tests/typecheck/test/test_client.yml::request_factories PASSED tests/typecheck/test/test_testcase.yml::testcase_client_attr PASSED tests/typecheck/test/test_utils.yml::override_settings PASSED tests/typecheck/urls/test_conf.yml::test_path_accepts_mix_of_pattern_and_resolver_output PASSED tests/typecheck/urls/test_conf.yml::test_path_accepts_pattern_resolver_union_subset PASSED tests/typecheck/urls/test_conf.yml::test_urlconf_include PASSED tests/typecheck/utils/test_datastructures.yml::multivaluedict PASSED tests/typecheck/utils/test_decorators.yml::method_decorator_class PASSED tests/typecheck/utils/test_decorators.yml::method_decorator_function PASSED tests/typecheck/utils/test_encoding.yml::force_bytes_or_str PASSED tests/typecheck/utils/test_functional.yml::cached_property_class_vs_instance_attributes PASSED tests/typecheck/utils/test_functional.yml::str_promise_proxy PASSED tests/typecheck/utils/test_functional.yml::classproperty_usage PASSED tests/typecheck/utils/test_timezone.yml::is_naive_correct PASSED tests/typecheck/utils/test_timezone.yml::is_aware_correct PASSED tests/typecheck/views/test_function_based_views.yml::http_response PASSED tests/typecheck/views/test_function_based_views.yml::http_response_content PASSED tests/typecheck/views/test_function_based_views.yml::streaming_http_response PASSED tests/typecheck/views/test_function_based_views.yml::streaming_http_response_streaming_content PASSED tests/typecheck/views/generic/test_detail.yml::generic_detail_view PASSED tests/typecheck/views/generic/test_detail.yml::generic_detail_view_wrong PASSED tests/typecheck/views/generic/test_edit.yml::login_form_form_valid_typechecks PASSED tests/typecheck/views/generic/test_edit.yml::dispatch_http_response PASSED tests/typecheck/views/generic/test_edit.yml::dispatch_streaming_http_response PASSED tests/typecheck/views/generic/test_edit.yml::generic_form_views PASSED tests/typecheck/views/generic/test_edit.yml::generic_form_views_different_form_classes PASSED tests/typecheck/views/generic/test_list.yml::generic_list_view PASSED tests/typecheck/views/generic/test_list.yml::generic_list_view_wrong PASSED django_stubs_ext/tests/test_aliases.py::test_extends_values_queryset PASSED django_stubs_ext/tests/test_monkeypatching.py::test_patched_generics PASSED django_stubs_ext/tests/test_monkeypatching.py::test_patched_extra_classes_generics PASSED django_stubs_ext/tests/test_monkeypatching.py::test_patched_version_specific[django_version0] PASSED django_stubs_ext/tests/test_monkeypatching.py::test_patched_version_specific[django_version1] PASSED django_stubs_ext/tests/test_monkeypatching.py::test_patched_version_specific[django_version2] PASSED django_stubs_ext/tests/test_monkeypatching.py::test_patched_version_specific[django_version3] PASSED django_stubs_ext/tests/test_monkeypatching.py::test_patched_version_specific[django_version4] PASSED django_stubs_ext/tests/test_monkeypatching.py::test_patched_version_specific[django_version5] PASSED django_stubs_ext/tests/test_monkeypatching.py::test_mypy_builtins_not_patched_globally PASSED django_stubs_ext/tests/test_monkeypatching.py::test_mypy_builtins_patched PASSED django_stubs_ext/tests/typecheck/test_aliases.yml::alias_values_query_set PASSED django_stubs_ext/tests/typecheck/test_patching.yml::patch_reveal_type_during_django_setup PASSED ================================================== FAILURES ================================================== ______________________________ test_misconfiguration_handling[missing-section] _______________________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 65, in test_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n' usage: (config) ... [mypy.plugins.django_stubs] django_settings_module: str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show __________________________ test_misconfiguration_handling[missing-settings-module] ___________________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 65, in test_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' usage: (config) ... [mypy.plugins.django_stubs] django_settings_module: str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show _____________________________ test_misconfiguration_handling[no-settings-given] ______________________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 65, in test_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' usage: (config) ... [mypy.plugins.django_stubs] django_settings_module: str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show ___________________ test_toml_misconfiguration_handling[django_settings_module not string] ___________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 124, in test_toml_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert 'usage: \n(co...be a string\n' == 'usage: \n(co...ration file\n' usage: (config) ... [tool.django-stubs] django_settings_module = str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show _____________________ test_toml_misconfiguration_handling[missing django-stubs section] ______________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 124, in test_toml_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n' usage: (config) ... [tool.django-stubs] django_settings_module = str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show ____________________ test_toml_misconfiguration_handling[missing django_settings_module] _____________________ Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 124, in test_toml_misconfiguration_handling assert error_message == capsys.readouterr().err AssertionError: assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' usage: (config) ... [tool.django-stubs] django_settings_module = str (required) ... - (django-stubs) mypy: error: could not load configuration file... ...Full output truncated (2 lines hidden), use '-vv' to show ______________________________________ test_correct_toml_configuration _______________________________________ Traceback (most recent call last): File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 66, in parse_toml_file with filepath.open(mode="rb") as f: File "c:\users\livin\appdata\local\programs\python\python39-32\lib\pathlib.py", line 1241, in open return io.open(self, mode, buffering, encoding, errors, newline, File "c:\users\livin\appdata\local\programs\python\python39-32\lib\pathlib.py", line 1109, in _opener return self._accessor.open(self, flags, mode) PermissionError: [Errno 13] Permission denied: 'C:\\Users\\livin\\AppData\\Local\\Temp\\tmpu9y9oa9n.toml' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 135, in test_correct_toml_configuration config = DjangoPluginConfig(filename) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 59, in __init__ self.parse_toml_file(filepath) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 69, in parse_toml_file toml_exit(COULD_NOT_LOAD_FILE) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 43, in exit_with_error handler.error(msg) File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 388, in error self.exit(2, gettext("%(prog)s: error: %(message)s\n") % args) File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 375, in exit sys.exit(status) SystemExit: 2 _________________________________________ test_correct_configuration _________________________________________ Traceback (most recent call last): File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 86, in parse_ini_file with filepath.open(encoding="utf-8") as f: File "c:\users\livin\appdata\local\programs\python\python39-32\lib\pathlib.py", line 1241, in open return io.open(self, mode, buffering, encoding, errors, newline, File "c:\users\livin\appdata\local\programs\python\python39-32\lib\pathlib.py", line 1109, in _opener return self._accessor.open(self, flags, mode) PermissionError: [Errno 13] Permission denied: 'C:\\Users\\livin\\AppData\\Local\\Temp\\tmp_xxvd1ln' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\typedjango\django-stubs\tests\test_error_handling.py", line 150, in test_correct_configuration config = DjangoPluginConfig(filename) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 61, in __init__ self.parse_ini_file(filepath) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 89, in parse_ini_file exit_with_error(COULD_NOT_LOAD_FILE) File "d:\typedjango\django-stubs\mypy_django_plugin\config.py", line 43, in exit_with_error handler.error(msg) File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 388, in error self.exit(2, gettext("%(prog)s: error: %(message)s\n") % args) File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 375, in exit sys.exit(status) SystemExit: 2 ___________________________________________ pyproject_toml_config ____________________________________________ D:\typedjango\django-stubs\tests\typecheck\test_config.yml:8: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E ... E myapp\models:6: note: Revealed type is "django.contrib.auth.models.User" (diff) E Expected: E ... E myapp/models:6: note: Revealed type is "django.contrib.auth.models.User" (diff) E Alignment of first line difference: E E: myapp/models:6: note: Revealed type is "django.contrib.auth.models.User" E A: myapp\models:6: note: Revealed type is "django.contrib.auth.models.User" E ^ ____________________________ test_circular_dependency_in_imports_with_foreign_key ____________________________ D:\typedjango\django-stubs\tests\typecheck\fields\test_related.yml:133: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E myapp\models:4: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.View]" (diff) E myapp\models:5: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.Member]" (diff) E myapp\models:6: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.Sheet]" (diff) E myapp\models:7: note: Revealed type is "myapp.models.Profile" (diff) E Expected: E myapp/models:4: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.View]" (diff) E myapp/models:5: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.Member]" (diff) E myapp/models:6: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.Sheet]" (diff) E myapp/models:7: note: Revealed type is "myapp.models.Profile" (diff) E Alignment of first line difference: E E: myapp/models:4: note: Revealed type is "django.db.models.manager.Related... E A: myapp\models:4: note: Revealed type is "django.db.models.manager.Related... E ^ ___________________________ test_circular_dependency_in_imports_with_string_based ____________________________ D:\typedjango\django-stubs\tests\typecheck\fields\test_related.yml:158: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E ... E myapp2\models:4: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.View]" (diff) E Expected: E ... E myapp2/models:4: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.View]" (diff) E Alignment of first line difference: E E: myapp2/models:4: note: Revealed type is "django.db.models.manager.Relate... E A: myapp2\models:4: note: Revealed type is "django.db.models.manager.Relate... E ^ ______________________________ fail_if_no_model_in_the_same_app_models_init_py _______________________________ D:\typedjango\django-stubs\tests\typecheck\fields\test_related.yml:439: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E myapp\models\book:3: error: Cannot find model 'Publisher' referenced in field 'publisher' (diff) E Expected: E myapp/models/book:3: error: Cannot find model 'Publisher' referenced in field 'publisher' (diff) E Alignment of first line difference: E E: myapp/models/book:3: error: Cannot find model 'Publisher' referenced in ... E A: myapp\models\book:3: error: Cannot find model 'Publisher' referenced in ... E ^ _____________________ foreign_key_relationship_for_models_with_custom_manager_unsolvable _____________________ D:\typedjango\django-stubs\tests\typecheck\fields\test_related.yml:703: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E myapp\models:11: error: Could not resolve manager type for "myapp.models.Transaction.objects" (diff) E myapp\models:13: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.TransactionLog]" (diff) E myapp\models:15: note: Revealed type is "myapp.models.UnknownManager[myapp.models.Transaction]" (diff) E myapp\models:16: note: Revealed type is "Any" (diff) E Expected: E myapp/models:11: error: Could not resolve manager type for "myapp.models.Transaction.objects" (diff) E myapp/models:13: note: Revealed type is "django.db.models.manager.RelatedManager[myapp.models.TransactionLog]" (diff) E myapp/models:15: note: Revealed type is "myapp.models.UnknownManager[myapp.models.Transaction]" (diff) E myapp/models:16: note: Revealed type is "Any" (diff) E Alignment of first line difference: E E: myapp/models:11: error: Could not resolve manager type for "myapp.models... E A: myapp\models:11: error: Could not resolve manager type for "myapp.models... E ^ ____________________________ test_fails_if_app_label_is_unknown_in_relation_field ____________________________ D:\typedjango\django-stubs\tests\typecheck\fields\test_related.yml:936: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E installed\models:3: error: Cannot find model 'not_installed.NonInstalledModel' referenced in field 'non_installed' (diff) E Expected: E installed/models:3: error: Cannot find model 'not_installed.NonInstalledModel' referenced in field 'non_installed' (diff) E Alignment of first line difference: E E: installed/models:3: error: Cannot find model 'not_installed.NonInstalled... E A: installed\models:3: error: Cannot find model 'not_installed.NonInstalled... E ^ ___________ test_model_objects_attribute_present_in_case_of_model_cls_passed_as_generic_parameter ____________ D:\typedjango\django-stubs\tests\typecheck\managers\test_managers.yml:42: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E ... E myapp\models:8: note: Revealed type is "django.db.models.manager.BaseManager[_T`1]" (diff) E myapp\models:13: note: Revealed type is "django.db.models.manager.Manager[myapp.models.MyModel]" (diff) E Expected: E ... E myapp/models:8: note: Revealed type is "django.db.models.manager.BaseManager[_T`1]" (diff) E myapp/models:13: note: Revealed type is "django.db.models.manager.Manager[myapp.models.MyModel]" (diff) E Alignment of first line difference: E E: myapp/models:8: note: Revealed type is "django.db.models.manager.BaseMan... E A: myapp\models:8: note: Revealed type is "django.db.models.manager.BaseMan... E ^ _________________________ test_base_manager_called_on_model_cls_as_generic_parameter _________________________ D:\typedjango\django-stubs\tests\typecheck\managers\test_managers.yml:67: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E ... E myapp\models:8: note: Revealed type is "django.db.models.manager.BaseManager[_T`1]" (diff) E myapp\models:13: note: Revealed type is "django.db.models.manager.BaseManager[myapp.models.MyModel]" (diff) E Expected: E ... E myapp/models:8: note: Revealed type is "django.db.models.manager.BaseManager[_T`1]" (diff) E myapp/models:13: note: Revealed type is "django.db.models.manager.BaseManager[myapp.models.MyModel]" (diff) E Alignment of first line difference: E E: myapp/models:8: note: Revealed type is "django.db.models.manager.BaseMan... E A: myapp\models:8: note: Revealed type is "django.db.models.manager.BaseMan... E ^ __________________________________________ override_manager_create1 __________________________________________ D:\typedjango\django-stubs\tests\typecheck\managers\test_managers.yml:393: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E myapp\models:5: error: Return type "MyModel" of "create" incompatible with return type "_T" in supertype "BaseManager" (diff) E myapp\models:6: error: Incompatible return value type (got "_T", expected "MyModel") (diff) E Expected: E myapp/models:5: error: Return type "MyModel" of "create" incompatible with return type "_T" in supertype "BaseManager" (diff) E myapp/models:6: error: Incompatible return value type (got "_T", expected "MyModel") (diff) E Alignment of first line difference: E E: myapp/models:5: error: Return type "MyModel" of "create" incompatible wi... E A: myapp\models:5: error: Return type "MyModel" of "create" incompatible wi... E ^ __________________________________ test_emits_error_for_unresolved_managers __________________________________ D:\typedjango\django-stubs\tests\typecheck\managers\test_managers.yml:464: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E myapp\models:13: error: Couldn't resolve related manager for relation 'booking' (from myapp.models.Booking.myapp.Booking.renter). (diff) E myapp\models:13: error: Couldn't resolve related manager for relation 'bookingowner_set' (from myapp.models.Booking.myapp.Booking.owner). (diff) E myapp\models:20: error: Could not resolve manager type for "myapp.models.Booking.objects" (diff) E myapp\models:23: error: Could not resolve manager type for "myapp.models.TwoUnresolvable.objects" (diff) E myapp\models:24: error: Could not resolve manager type for "myapp.models.TwoUnresolvable.second_objects" (diff) E myapp\models:27: error: Could not resolve manager type for "myapp.models.AbstractUnresolvable.objects" (diff) E myapp\models:32: error: Could not resolve manager type for "myapp.models.InvisibleUnresolvable.objects" (diff) E myapp\models:36: note: Revealed type is "django.db.models.manager.Manager[myapp.models.User]" (diff) E myapp\models:37: note: Revealed type is "django.db.models.manager.Manager[myapp.models.User]" (diff) E myapp\models:39: note: Revealed type is "myapp.models.UnknownManager[myapp.models.Booking]" (diff) E myapp\models:40: note: Revealed type is "django.db.models.manager.BaseManager[myapp.models.Booking]" (diff) E myapp\models:42: note: Revealed type is "myapp.models.UnknownManager[myapp.models.TwoUnresolvable]" (diff) E myapp\models:43: note: Revealed type is "myapp.models.UnknownManager[myapp.models.TwoUnresolvable]" (diff) E myapp\models:44: note: Revealed type is "django.db.models.manager.BaseManager[myapp.models.TwoUnresolvable]" (diff) E myapp\models:46: note: Revealed type is "myapp.models.UnknownManager[myapp.models.InvisibleUnresolvable]" (diff) E myapp\models:47: note: Revealed type is "django.db.models.manager.BaseManager[myapp.models.InvisibleUnresolvable]" (diff) E myapp\models:49: note: Revealed type is "myapp.models.UnknownRelatedManager[myapp.models.Booking]" (diff) E myapp\models:50: note: Revealed type is "myapp.models.UnknownRelatedManager[myapp.models.Booking]" (diff) E myapp\models:53: note: Revealed type is "def () -> myapp.models.UnknownQuerySet[myapp.models.Booking, myapp.models.Booking]" (diff) E myapp\models:54: note: Revealed type is "Any" (diff) E myapp\models:55: note: Revealed type is "def (*args: Any, **kwargs: Any) -> myapp.models.UnknownQuerySet[myapp.models.Booking, myapp.models.Booking]" (diff) E myapp\models:56: note: Revealed type is "Any" (diff) E myapp\models:57: note: Revealed type is "Union[myapp.models.Booking, None]" (diff) E myapp\models:58: note: Revealed type is "myapp.models.Booking" (diff) E myapp\models:59: note: Revealed type is "builtins.list[myapp.models.Booking]" (diff) E myapp\models:60: note: Revealed type is "builtins.list[myapp.models.Booking]" (diff) E myapp\models:64: note: Revealed type is "def () -> myapp.models.UnknownQuerySet[myapp.models.Booking, myapp.models.Booking]" (diff) E myapp\models:65: note: Revealed type is "Any" (diff) E myapp\models:66: note: Revealed type is "def (*args: Any, **kwargs: Any) -> myapp.models.UnknownQuerySet[myapp.models.Booking, myapp.models.Booking]" (diff) E myapp\models:67: note: Revealed type is "Any" (diff) E myapp\models:68: note: Revealed type is "Union[myapp.models.Booking, None]" (diff) E Expected: E myapp/models:13: error: Couldn't resolve related manager for relation 'booking' (from myapp.models.Booking.myapp.Booking.renter). (diff) E myapp/models:13: error: Couldn't resolve related manager for relation 'bookingowner_set' (from myapp.models.Booking.myapp.Booking.owner). (diff) E myapp/models:20: error: Could not resolve manager type for "myapp.models.Booking.objects" (diff) E myapp/models:23: error: Could not resolve manager type for "myapp.models.TwoUnresolvable.objects" (diff) E myapp/models:24: error: Could not resolve manager type for "myapp.models.TwoUnresolvable.second_objects" (diff) E myapp/models:27: error: Could not resolve manager type for "myapp.models.AbstractUnresolvable.objects" (diff) E myapp/models:32: error: Could not resolve manager type for "myapp.models.InvisibleUnresolvable.objects" (diff) E myapp/models:36: note: Revealed type is "django.db.models.manager.Manager[myapp.models.User]" (diff) E myapp/models:37: note: Revealed type is "django.db.models.manager.Manager[myapp.models.User]" (diff) E myapp/models:39: note: Revealed type is "myapp.models.UnknownManager[myapp.models.Booking]" (diff) E myapp/models:40: note: Revealed type is "django.db.models.manager.BaseManager[myapp.models.Booking]" (diff) E myapp/models:42: note: Revealed type is "myapp.models.UnknownManager[myapp.models.TwoUnresolvable]" (diff) E myapp/models:43: note: Revealed type is "myapp.models.UnknownManager[myapp.models.TwoUnresolvable]" (diff) E myapp/models:44: note: Revealed type is "django.db.models.manager.BaseManager[myapp.models.TwoUnresolvable]" (diff) E myapp/models:46: note: Revealed type is "myapp.models.UnknownManager[myapp.models.InvisibleUnresolvable]" (diff) E myapp/models:47: note: Revealed type is "django.db.models.manager.BaseManager[myapp.models.InvisibleUnresolvable]" (diff) E myapp/models:49: note: Revealed type is "myapp.models.UnknownRelatedManager[myapp.models.Booking]" (diff) E myapp/models:50: note: Revealed type is "myapp.models.UnknownRelatedManager[myapp.models.Booking]" (diff) E myapp/models:53: note: Revealed type is "def () -> myapp.models.UnknownQuerySet[myapp.models.Booking, myapp.models.Booking]" (diff) E myapp/models:54: note: Revealed type is "Any" (diff) E myapp/models:55: note: Revealed type is "def (*args: Any, **kwargs: Any) -> myapp.models.UnknownQuerySet[myapp.models.Booking, myapp.models.Booking]" (diff) E myapp/models:56: note: Revealed type is "Any" (diff) E myapp/models:57: note: Revealed type is "Union[myapp.models.Booking, None]" (diff) E myapp/models:58: note: Revealed type is "myapp.models.Booking" (diff) E myapp/models:59: note: Revealed type is "builtins.list[myapp.models.Booking]" (diff) E myapp/models:60: note: Revealed type is "builtins.list[myapp.models.Booking]" (diff) E myapp/models:64: note: Revealed type is "def () -> myapp.models.UnknownQuerySet[myapp.models.Booking, myapp.models.Booking]" (diff) E myapp/models:65: note: Revealed type is "Any" (diff) E myapp/models:66: note: Revealed type is "def (*args: Any, **kwargs: Any) -> myapp.models.UnknownQuerySet[myapp.models.Booking, myapp.models.Booking]" (diff) E myapp/models:67: note: Revealed type is "Any" (diff) E myapp/models:68: note: Revealed type is "Union[myapp.models.Booking, None]" (diff) E Alignment of first line difference: E E: myapp/models:13: error: Couldn't resolve related manager for relation 'b... E A: myapp\models:13: error: Couldn't resolve related manager for relation 'b... E ^ _______________________ subclass_manager_without_type_parameters_disallow_any_generics _______________________ D:\typedjango\django-stubs\tests\typecheck\managers\test_managers.yml:598: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E ... E myapp\models:9: error: Missing type parameters for generic type "MyManager" (diff) E Expected: E ... E myapp/models:9: error: Missing type parameters for generic type "MyManager" (diff) E Alignment of first line difference: E E: myapp/models:9: error: Missing type parameters for generic type "MyManag... E A: myapp\models:9: error: Missing type parameters for generic type "MyManag... E ^ ____________________________ test_fetch_pk_with_custom_manager_on_abstract_model _____________________________ D:\typedjango\django-stubs\tests\typecheck\models\test_abstract.yml:25: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E myapp\models:13: note: Revealed type is "django.db.models.query._QuerySet[myapp.models.BaseModel, Tuple[Any]]" (diff) E Expected: E myapp/models:13: note: Revealed type is "django.db.models.query._QuerySet[myapp.models.BaseModel, Tuple[Any]]" (diff) E Alignment of first line difference: E E: myapp/models:13: note: Revealed type is "django.db.models.query._QuerySe... E A: myapp\models:13: note: Revealed type is "django.db.models.query._QuerySe... E ^ ______________________________ django_contrib_gis_base_model_mixin_inheritance _______________________________ D:\typedjango\django-stubs\tests\typecheck\models\test_inheritance.yml:93: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E Error constructing plugin instance of NewSemanalDjangoPlugin (diff) E Traceback (most recent call last): (diff) E File "c:\users\livin\appdata\local\programs\python\python39-32\lib\runpy.py", line 197, in _run_module_as_main (diff) E return _run_code(code, main_globals, None, (diff) E File "c:\users\livin\appdata\local\programs\python\python39-32\lib\runpy.py", line 87, in _run_code (diff) E exec(code, run_globals) (diff) E File "D:\typedjango\env\Scripts\mypy.EXE\__main__.py", line 7, in (diff) E File "D:\typedjango\env\lib\site-packages\mypy\__main__.py", line 15, in console_entry (diff) E main() (diff) E File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 95, in main (diff) E res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr) (diff) E File "D:\typedjango\env\lib\site-packages\mypy\main.py", line 174, in run_build (diff) E res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr) (diff) E File "D:\typedjango\env\lib\site-packages\mypy\build.py", line 194, in build (diff) E result = _build( (diff) E File "D:\typedjango\env\lib\site-packages\mypy\build.py", line 249, in _build (diff) E plugin, snapshot = load_plugins(options, errors, stdout, extra_plugins) (diff) E File "D:\typedjango\env\lib\site-packages\mypy\build.py", line 510, in load_plugins (diff) E custom_plugins, snapshot = load_plugins_from_config(options, errors, stdout) (diff) E File "D:\typedjango\env\lib\site-packages\mypy\build.py", line 491, in load_plugins_from_config (diff) E custom_plugins.append(plugin_type(options)) (diff) E File "d:\typedjango\django-stubs\mypy_django_plugin\main.py", line 73, in __init__ (diff) E self.django_context = DjangoContext(self.plugin_config.django_settings_module) (diff) E File "d:\typedjango\django-stubs\mypy_django_plugin\django\context.py", line 85, in __init__ (diff) E apps, settings = initialize_django(self.django_settings_module) (diff) E File "d:\typedjango\django-stubs\mypy_django_plugin\django\context.py", line 69, in initialize_django (diff) E apps.populate(settings.INSTALLED_APPS) (diff) E File "D:\typedjango\env\lib\site-packages\django\apps\registry.py", line 114, in populate (diff) E app_config.import_models() (diff) E File "D:\typedjango\env\lib\site-packages\django\apps\config.py", line 301, in import_models (diff) E self.models_module = import_module(models_module_name) (diff) E File "c:\users\livin\appdata\local\programs\python\python39-32\lib\importlib\__init__.py", line 127, in import_module (diff) E return _bootstrap._gcd_import(name[level:], package, level) (diff) E File "", line 1030, in _gcd_import (diff) E File "", line 1007, in _find_and_load (diff) E File "", line 986, in _find_and_load_unlocked (diff) E File "", line 680, in _load_unlocked (diff) E File "", line 790, in exec_module (diff) E File "", line 228, in _call_with_frames_removed (diff) E File "C:\Users\livin\AppData\Local\Temp\pytest-mypy-2z4xca3b\myapp\models.py", line 2, in (diff) E from django.contrib.gis.db import models as gis_models (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\db\models\__init__.py", line 3, in (diff) E import django.contrib.gis.db.models.functions # NOQA (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\db\models\functions.py", line 3, in (diff) E from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\db\models\fields.py", line 3, in (diff) E from django.contrib.gis import forms, gdal (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\forms\__init__.py", line 3, in (diff) E from .fields import ( # NOQA (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\forms\fields.py", line 2, in (diff) E from django.contrib.gis.gdal import GDALException (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\gdal\__init__.py", line 28, in (diff) E from django.contrib.gis.gdal.datasource import DataSource (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\gdal\datasource.py", line 40, in (diff) E from django.contrib.gis.gdal.driver import Driver (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\gdal\driver.py", line 5, in (diff) E from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\gdal\prototypes\ds.py", line 9, in (diff) E from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal (diff) E File "D:\typedjango\env\lib\site-packages\django\contrib\gis\gdal\libgdal.py", line 41, in (diff) E lib_path = find_library(lib_name) (diff) E File "c:\users\livin\appdata\local\programs\python\python39-32\lib\ctypes\util.py", line 59, in find_library (diff) E for directory in os.environ['PATH'].split(os.pathsep): (diff) E File "c:\users\livin\appdata\local\programs\python\python39-32\lib\os.py", line 679, in __getitem__ (diff) E raise KeyError(key) from None (diff) E KeyError: 'PATH' (diff) E Expected: E main:2: note: Revealed type is "builtins.str" (diff) E main:3: note: Revealed type is "datetime.datetime" (diff) E Alignment of first line difference: E E: main:2: note: Revealed type is "builtins.str" E A: Error constructing plugin instance of NewSemanalDjangoPlugin E ^ _______________________ test_access_to_id_field_through_self_if_no_primary_key_defined _______________________ D:\typedjango\django-stubs\tests\typecheck\models\test_primary_key.yml:6: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E ... E myapp\models:4: note: Revealed type is "builtins.int" (diff) E myapp\models:5: note: Revealed type is "builtins.int" (diff) E Expected: E ... E myapp/models:4: note: Revealed type is "builtins.int" (diff) E myapp/models:5: note: Revealed type is "builtins.int" (diff) E Alignment of first line difference: E E: myapp/models:4: note: Revealed type is "builtins.int" E A: myapp\models:4: note: Revealed type is "builtins.int" E ^ _______________________ test_access_to_id_field_through_self_if_primary_key_is_defined _______________________ D:\typedjango\django-stubs\tests\typecheck\models\test_primary_key.yml:29: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E ... E myapp\models:5: note: Revealed type is "builtins.str" (diff) E myapp\models:6: note: Revealed type is "builtins.str" (diff) E Expected: E ... E myapp/models:5: note: Revealed type is "builtins.str" (diff) E myapp/models:6: note: Revealed type is "builtins.str" (diff) E Alignment of first line difference: E E: myapp/models:5: note: Revealed type is "builtins.str" E A: myapp\models:5: note: Revealed type is "builtins.str" E ^ ___________________ test_access_to_id_field_through_self_if_primary_key_has_different_name ___________________ D:\typedjango\django-stubs\tests\typecheck\models\test_primary_key.yml:52: E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: E Actual: E ... E myapp\models:5: note: Revealed type is "builtins.str" (diff) E myapp\models:6: note: Revealed type is "builtins.str" (diff) E myapp\models:7: error: "MyModel" has no attribute "id" (diff) E Expected: E ... E myapp/models:5: note: Revealed type is "builtins.str" (diff) E myapp/models:6: note: Revealed type is "builtins.str" (diff) E myapp/models:7: error: "MyModel" has no attribute "id" (diff) E Alignment of first line difference: E E: myapp/models:5: note: Revealed type is "builtins.str" E A: myapp\models:5: note: Revealed type is "builtins.str" E ^ ========================================== short test summary info =========================================== FAILED tests/test_error_handling.py::test_misconfiguration_handling[missing-section] - AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_misconfiguration_handling[missing-settings-module] - assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_misconfiguration_handling[no-settings-given] - assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[django_settings_module not string] - AssertionError: assert 'usage: \n(co...be a string\n' == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django-stubs section] - AssertionError: assert 'usage: \n(co...tubs] found\n' == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_toml_misconfiguration_handling[missing django_settings_module] - assert "usage: \n(co...ule' config\n" == 'usage: \n(co...ration file\n' FAILED tests/test_error_handling.py::test_correct_toml_configuration - SystemExit: 2 FAILED tests/test_error_handling.py::test_correct_configuration - SystemExit: 2 FAILED tests/typecheck/test_config.yml::pyproject_toml_config - FAILED tests/typecheck/fields/test_related.yml::test_circular_dependency_in_imports_with_foreign_key - FAILED tests/typecheck/fields/test_related.yml::test_circular_dependency_in_imports_with_string_based - FAILED tests/typecheck/fields/test_related.yml::fail_if_no_model_in_the_same_app_models_init_py - FAILED tests/typecheck/fields/test_related.yml::foreign_key_relationship_for_models_with_custom_manager_unsolvable - FAILED tests/typecheck/fields/test_related.yml::test_fails_if_app_label_is_unknown_in_relation_field - FAILED tests/typecheck/managers/test_managers.yml::test_model_objects_attribute_present_in_case_of_model_cls_passed_as_generic_parameter - FAILED tests/typecheck/managers/test_managers.yml::test_base_manager_called_on_model_cls_as_generic_parameter - FAILED tests/typecheck/managers/test_managers.yml::override_manager_create1 - FAILED tests/typecheck/managers/test_managers.yml::test_emits_error_for_unresolved_managers - FAILED tests/typecheck/managers/test_managers.yml::subclass_manager_without_type_parameters_disallow_any_generics - FAILED tests/typecheck/models/test_abstract.yml::test_fetch_pk_with_custom_manager_on_abstract_model - FAILED tests/typecheck/models/test_inheritance.yml::django_contrib_gis_base_model_mixin_inheritance - FAILED tests/typecheck/models/test_primary_key.yml::test_access_to_id_field_through_self_if_no_primary_key_defined - FAILED tests/typecheck/models/test_primary_key.yml::test_access_to_id_field_through_self_if_primary_key_is_defined - FAILED tests/typecheck/models/test_primary_key.yml::test_access_to_id_field_through_self_if_primary_key_has_different_name - ================================ 24 failed, 330 passed in 4540.98s (1:15:40) ================================= ```
intgr commented 1 year ago

Anyway you can just open a PR and see if it passes in our CI.

RyanWalker277 commented 1 year ago

I have made sure to clear the cache and installed everything from requirements.txt I followed the CONTRIBUTING.md file for every step.

I recieved the following result from the pytest:

These are specefic to your local machine, some of the failures are due to denied access to the toml files and other are because pytest can't load the mypy config file. As @intgr said, you can check them on our CI by making a PR. Meanwhile, you can also keep a track of the failed test cases and make sure that your changes pass rest of the test cases. Also, IMO using wsl would be a better option.

lklivingstone commented 1 year ago

Thanks! I will surely check out WSL. I am quite new to contributing, so still discovering things.