Closed rossmechanic closed 1 year ago
Hello, I think I might be able to solve this issue. Can I be assigned?
@lklivingstone you don't need to be assigned :) Just pick it up! Thanks!
Sure I will get to it.
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.
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.
Make sure you have the correct dependency versions: pip install -r requirements.txt
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:
Anyway you can just open a PR and see if it passes in our CI.
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.
Thanks! I will surely check out WSL. I am quite new to contributing, so still discovering things.
Bug report
What's wrong
When passing
validate_constraints=False
into theModel.full_clean
function, I get acall-arg
type error because that argument hasn't yet been added to django-stubs.How is that should be
The
validate_constraints
keyword arg should be added to thefull_clean
stub.System information
python
version: 3.11django
version: 4.1mypy
version: 0.991django-stubs
version: 1.14.0django-stubs-ext
version: 0.7.0