repo
stringclasses
10 values
instance_id
stringlengths
18
32
base_commit
stringlengths
40
40
patch
stringlengths
365
17.4k
test_patch
stringlengths
394
6.74k
problem_statement
stringlengths
190
5.36k
hints_text
stringlengths
0
15.4k
created_at
stringdate
2013-01-25 05:19:16
2023-07-24 22:46:12
version
stringlengths
3
7
FAIL_TO_PASS
stringlengths
12
32.6k
PASS_TO_PASS
stringlengths
2
114k
environment_setup_commit
stringlengths
40
40
difficulty
stringclasses
4 values
__index_level_0__
int64
0
497
scikit-learn/scikit-learn
scikit-learn__scikit-learn-13439
a62775e99f2a5ea3d51db7160fad783f6cd8a4c5
diff --git a/sklearn/pipeline.py b/sklearn/pipeline.py --- a/sklearn/pipeline.py +++ b/sklearn/pipeline.py @@ -199,6 +199,12 @@ def _iter(self, with_final=True): if trans is not None and trans != 'passthrough': yield idx, name, trans + def __len__(self): + """ + Returns ...
diff --git a/sklearn/tests/test_pipeline.py b/sklearn/tests/test_pipeline.py --- a/sklearn/tests/test_pipeline.py +++ b/sklearn/tests/test_pipeline.py @@ -1069,5 +1069,6 @@ def test_make_pipeline_memory(): assert pipeline.memory is memory pipeline = make_pipeline(DummyTransf(), SVC()) assert pipeline.mem...
Pipeline should implement __len__ #### Description With the new indexing support `pipe[:len(pipe)]` raises an error. #### Steps/Code to Reproduce ```python from sklearn import svm from sklearn.datasets import samples_generator from sklearn.feature_selection import SelectKBest from sklearn.feature_selection...
None should work just as well, but perhaps you're right that len should be implemented. I don't think we should implement other things from sequences such as iter, however. I think len would be good to have but I would also try to add as little as possible. +1 > I am looking at it.
2019-03-12T20:32:50Z
0.21
["sklearn/tests/test_pipeline.py::test_make_pipeline_memory"]
["sklearn/tests/test_pipeline.py::test_pipeline_init", "sklearn/tests/test_pipeline.py::test_pipeline_init_tuple", "sklearn/tests/test_pipeline.py::test_pipeline_methods_anova", "sklearn/tests/test_pipeline.py::test_pipeline_fit_params", "sklearn/tests/test_pipeline.py::test_pipeline_sample_weight_supported", "sklearn/...
7813f7efb5b2012412888b69e73d76f2df2b50b6
<15 min fix
361
django/django
django__django-12155
e8fcdaad5c428878d0a5d6ba820d957013f75595
diff --git a/django/contrib/admindocs/utils.py b/django/contrib/admindocs/utils.py --- a/django/contrib/admindocs/utils.py +++ b/django/contrib/admindocs/utils.py @@ -3,6 +3,7 @@ import re from email.errors import HeaderParseError from email.parser import HeaderParser +from inspect import cleandoc from django.url...
diff --git a/tests/admin_docs/test_utils.py b/tests/admin_docs/test_utils.py --- a/tests/admin_docs/test_utils.py +++ b/tests/admin_docs/test_utils.py @@ -1,8 +1,9 @@ import unittest from django.contrib.admindocs.utils import ( - docutils_is_available, parse_docstring, parse_rst, trim_docstring, + docutils_is...
docutils reports an error rendering view docstring when the first line is not empty Description Currently admindoc works correctly only with docstrings where the first line is empty, and all Django docstrings are formatted in this way. However usually the docstring text starts at the first line, e.g.: def test(): ""...
Confirmed the patch fixes the issue, although it crashes for some tests with ValueError: min() arg is an empty sequence. We should probably just switch to inspect.cleandoc as ​it implements the algorithm ​defined in PEP257. Replying to Tim Graham: Confirmed the patch fixes the issue, although it crashes for some tests ...
2019-11-28T16:24:23Z
3.1
["test_parse_rst_with_docstring_no_leading_line_feed (admin_docs.test_utils.TestUtils)"]
["test_description_output (admin_docs.test_utils.TestUtils)", "test_initial_header_level (admin_docs.test_utils.TestUtils)", "test_parse_docstring (admin_docs.test_utils.TestUtils)", "test_parse_rst (admin_docs.test_utils.TestUtils)", "test_publish_parts (admin_docs.test_utils.TestUtils)", "test_title_output (admin_doc...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
73
scikit-learn/scikit-learn
scikit-learn__scikit-learn-25232
f7eea978097085a6781a0e92fc14ba7712a52d75
diff --git a/sklearn/impute/_iterative.py b/sklearn/impute/_iterative.py --- a/sklearn/impute/_iterative.py +++ b/sklearn/impute/_iterative.py @@ -117,6 +117,15 @@ class IterativeImputer(_BaseImputer): Which strategy to use to initialize the missing values. Same as the `strategy` parameter in :class:`...
diff --git a/sklearn/impute/tests/test_impute.py b/sklearn/impute/tests/test_impute.py --- a/sklearn/impute/tests/test_impute.py +++ b/sklearn/impute/tests/test_impute.py @@ -1524,6 +1524,21 @@ def test_iterative_imputer_keep_empty_features(initial_strategy): assert_allclose(X_imputed[:, 1], 0) +def test_itera...
IterativeImputer has no parameter "fill_value" ### Describe the workflow you want to enable In the first imputation round of `IterativeImputer`, an initial value needs to be set for the missing values. From its [docs](https://scikit-learn.org/stable/modules/generated/sklearn.impute.IterativeImputer.html): > **ini...
I think that we could consider that as a bug. We will have to add this parameter. Nowadays, I would find it easier just to pass a `SimpleImputer` instance. @glemaitre Thanks for your suggestion: > pass a SimpleImputer instance. Here is what I tried: `from sklearn.experimental import enable_iterative_imputer # ...
2022-12-24T15:32:44Z
1.3
["sklearn/impute/tests/test_impute.py::test_iterative_imputer_constant_fill_value"]
["sklearn/impute/tests/test_impute.py::test_imputation_shape[mean]", "sklearn/impute/tests/test_impute.py::test_imputation_shape[median]", "sklearn/impute/tests/test_impute.py::test_imputation_shape[most_frequent]", "sklearn/impute/tests/test_impute.py::test_imputation_shape[constant]", "sklearn/impute/tests/test_imput...
1e8a5b833d1b58f3ab84099c4582239af854b23a
<15 min fix
374
django/django
django__django-14434
5e04e84d67da8163f365e9f5fcd169e2630e2873
diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -1241,9 +1241,9 @@ def create_unique_name(*args, **kwargs): return self.quote_name(self._create_index_name(*args, **kwargs)) compi...
diff --git a/tests/schema/tests.py b/tests/schema/tests.py --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -2198,6 +2198,22 @@ def test_remove_unique_together_does_not_remove_meta_constraints(self): AuthorWithUniqueNameAndBirthday._meta.constraints = [] editor.remove_constraint(Auth...
Statement created by _create_unique_sql makes references_column always false Description This is due to an instance of Table is passed as an argument to Columns when a string is expected.
2021-05-23T12:27:14Z
4.0
["test_unique_constraint (schema.tests.SchemaTests)"]
["effective_default() should be used for DateField, DateTimeField, and", "Tests adding fields to models", "Tests binary fields get a sane default (#22851)", "test_add_field_db_collation (schema.tests.SchemaTests)", "test_add_field_default_dropped (schema.tests.SchemaTests)", "test_add_field_default_nullable (schema.tes...
475cffd1d64c690cdad16ede4d5e81985738ceb4
15 min - 1 hour
155
django/django
django__django-13279
6e9c5ee88fc948e05b4a7d9f82a8861ed2b0343d
diff --git a/django/contrib/sessions/backends/base.py b/django/contrib/sessions/backends/base.py --- a/django/contrib/sessions/backends/base.py +++ b/django/contrib/sessions/backends/base.py @@ -108,6 +108,9 @@ def _hash(self, value): def encode(self, session_dict): "Return the given session dictionary ...
diff --git a/tests/sessions_tests/tests.py b/tests/sessions_tests/tests.py --- a/tests/sessions_tests/tests.py +++ b/tests/sessions_tests/tests.py @@ -31,9 +31,11 @@ from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation from django.http import HttpResponse from django.test import ( - Reques...
Session data cannot be decoded during the transition to Django 3.1. Description In d4fff711d4c97356bd6ba1273d2a5e349326eb5f (#31274) we've changed format for session data, that's why setting DEFAULT_HASHING_ALGORITHM to 'sha1' is not enough to support running multiple instances of the same project during the transiti...
2020-08-07T05:15:16Z
3.2
["test_default_hashing_algorith_legacy_decode (sessions_tests.tests.CookieSessionTests)", "test_default_hashing_algorith_legacy_decode (sessions_tests.tests.CacheSessionTests)", "test_default_hashing_algorith_legacy_decode (sessions_tests.tests.FileSessionTests)", "test_default_hashing_algorith_legacy_decode (sessions_...
["test_clear (sessions_tests.tests.CookieSessionTests)", "test_custom_expiry_datetime (sessions_tests.tests.CookieSessionTests)", "test_custom_expiry_reset (sessions_tests.tests.CookieSessionTests)", "test_custom_expiry_seconds (sessions_tests.tests.CookieSessionTests)", "test_custom_expiry_timedelta (sessions_tests.te...
65dfb06a1ab56c238cc80f5e1c31f61210c4577d
15 min - 1 hour
104
sphinx-doc/sphinx
sphinx-doc__sphinx-7757
212fd67b9f0b4fae6a7c3501fdf1a9a5b2801329
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -518,19 +518,34 @@ def signature_from_str(signature: str) -> inspect.Signature: # parameters args = definition.args + defaults = list(args.defaults) params = [] + if hasattr(a...
diff --git a/tests/test_util_inspect.py b/tests/test_util_inspect.py --- a/tests/test_util_inspect.py +++ b/tests/test_util_inspect.py @@ -335,10 +335,14 @@ def test_signature_from_str_kwonly_args(): @pytest.mark.skipif(sys.version_info < (3, 8), reason='python-3.8 or above is required') def test...
The default value for positional only argument has vanished **Describe the bug** The default value for positional only argument has vanished **To Reproduce** Build following document: ``` .. py:function:: foo(a, b=0, /, c=1) ``` Result: <img width="148" alt="スクリーンショット 2020-05-30 23 43 01" src="https://use...
2020-05-30T14:46:01Z
3.1
["tests/test_util_inspect.py::test_signature_from_str_positionaly_only_args"]
["tests/test_util_inspect.py::test_signature", "tests/test_util_inspect.py::test_signature_partial", "tests/test_util_inspect.py::test_signature_methods", "tests/test_util_inspect.py::test_signature_partialmethod", "tests/test_util_inspect.py::test_signature_annotations", "tests/test_util_inspect.py::test_signature_ann...
5afc77ee27fc01c57165ab260d3a76751f9ddb35
15 min - 1 hour
394
scikit-learn/scikit-learn
scikit-learn__scikit-learn-25973
10dbc142bd17ccf7bd38eec2ac04b52ce0d1009e
diff --git a/sklearn/feature_selection/_sequential.py b/sklearn/feature_selection/_sequential.py --- a/sklearn/feature_selection/_sequential.py +++ b/sklearn/feature_selection/_sequential.py @@ -8,12 +8,12 @@ import warnings from ._base import SelectorMixin -from ..base import BaseEstimator, MetaEstimatorMixin, clo...
diff --git a/sklearn/feature_selection/tests/test_sequential.py b/sklearn/feature_selection/tests/test_sequential.py --- a/sklearn/feature_selection/tests/test_sequential.py +++ b/sklearn/feature_selection/tests/test_sequential.py @@ -6,11 +6,12 @@ from sklearn.preprocessing import StandardScaler from sklearn.pipelin...
Unable to pass splits to SequentialFeatureSelector ### Describe the bug This runs fine with e.g. `cv=5`, but according to the documentation, it should also be able to take an iterable of splits. However, passing splits from the cross validator fails Im fairly certain I have done similar things in the past to other...
The internal algorithm will use the `cv` parameter in a `for` loop. If `cv` is a generator, it will be consumed at the first iteration only. Later it trigger the error because we did not complete the other iteration of the `for` loop. Passing a list (e.g. `cv=list(splits)`) will solve the problem because we can reus...
2023-03-25T13:27:07Z
1.3
["sklearn/feature_selection/tests/test_sequential.py::test_cv_generator_support"]
["sklearn/feature_selection/tests/test_sequential.py::test_bad_n_features_to_select", "sklearn/feature_selection/tests/test_sequential.py::test_n_features_to_select[1-forward]", "sklearn/feature_selection/tests/test_sequential.py::test_n_features_to_select[1-backward]", "sklearn/feature_selection/tests/test_sequential....
1e8a5b833d1b58f3ab84099c4582239af854b23a
<15 min fix
377
django/django
django__django-13670
c448e614c60cc97c6194c62052363f4f501e0953
diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py --- a/django/utils/dateformat.py +++ b/django/utils/dateformat.py @@ -325,8 +325,8 @@ def W(self): return self.data.isocalendar()[1] def y(self): - "Year, 2 digits; e.g. '99'" - return str(self.data.year)[2:] + """...
diff --git a/tests/utils_tests/test_dateformat.py b/tests/utils_tests/test_dateformat.py --- a/tests/utils_tests/test_dateformat.py +++ b/tests/utils_tests/test_dateformat.py @@ -165,3 +165,16 @@ def test_r_format_with_non_en_locale(self): dateformat.format(dt, 'r'), 'Sun, 08 Jul 1979 ...
dateformat.y() doesn't support years < 1000. Description (last modified by Sam) When using the the dateformat of django with a date before 999 (or 99 and 9 for similar matters) and the format character "y" no leading zero will be printed. This is not consistent with the way the python datetime module and PHP ha...
2020-11-12T11:45:51Z
3.2
["test_year_before_1000 (utils_tests.test_dateformat.DateFormatTests)"]
["test_am_pm (utils_tests.test_dateformat.DateFormatTests)", "test_date (utils_tests.test_dateformat.DateFormatTests)", "test_date_formats (utils_tests.test_dateformat.DateFormatTests)", "test_dateformat (utils_tests.test_dateformat.DateFormatTests)", "test_datetime_with_local_tzinfo (utils_tests.test_dateformat.DateFo...
65dfb06a1ab56c238cc80f5e1c31f61210c4577d
15 min - 1 hour
124
django/django
django__django-11999
84633905273fc916e3d17883810d9969c03f73c2
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -763,8 +763,12 @@ def contribute_to_class(self, cls, name, private_only=False): if not getattr(cls, self.attname, None): ...
diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -168,6 +168,16 @@ def test_get_FIELD_display_translated(self): self.assertIsInstance(val, str) self.assertEqual(val, 'translated') + def test_overriding_FI...
Cannot override get_FOO_display() in Django 2.2+. Description I cannot override the get_FIELD_display function on models since version 2.2. It works in version 2.1. Example: class FooBar(models.Model): foo_bar = models.CharField(_("foo"), choices=[(1, 'foo'), (2, 'bar')]) def __str__(self): return self.get_foo_ba...
Thanks for this report. Regression in a68ea231012434b522ce45c513d84add516afa60. Reproduced at 54a7b021125d23a248e70ba17bf8b10bc8619234. OK, I have a lead on this. Not at all happy about how it looks at first pass, but I'll a proof of concept PR together for it tomorrow AM. I don't think it should be marked as blocker s...
2019-10-31T10:39:18Z
3.1
["test_overriding_FIELD_display (model_fields.tests.GetFieldDisplayTests)"]
["test_blank_in_choices (model_fields.tests.GetChoicesTests)", "test_blank_in_grouped_choices (model_fields.tests.GetChoicesTests)", "test_empty_choices (model_fields.tests.GetChoicesTests)", "test_lazy_strings_not_evaluated (model_fields.tests.GetChoicesTests)", "test_check (model_fields.tests.ChoicesTests)", "test_ch...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
68
sympy/sympy
sympy__sympy-15599
5e17a90c19f7eecfa10c1ab872648ae7e2131323
diff --git a/sympy/core/mod.py b/sympy/core/mod.py --- a/sympy/core/mod.py +++ b/sympy/core/mod.py @@ -1,6 +1,7 @@ from __future__ import print_function, division -from sympy.core.numbers import nan +from sympy.core.numbers import nan, Integer +from sympy.core.compatibility import integer_types from .function impor...
diff --git a/sympy/core/tests/test_arit.py b/sympy/core/tests/test_arit.py --- a/sympy/core/tests/test_arit.py +++ b/sympy/core/tests/test_arit.py @@ -1662,6 +1662,12 @@ def test_Mod(): assert Mod(Mod(x + 2, 4)*(x + 4), 4) == Mod(x*(x + 2), 4) assert Mod(Mod(x + 2, 4)*4, 4) == 0 + # issue 15493 + i, j...
Mod(3*i, 2) unchanged `Mod(3*i, 2)` should reduce to `Mod(i, 2)` (as reported in [this post](https://stackoverflow.com/questions/53302669/sympify-does-not-simplify-remainder-as-expected)) and will do so with a change something like this: ```diff diff --git a/sympy/core/mod.py b/sympy/core/mod.py index eae2563..b1ff8...
@smichr I would like to start working the issue I would like to work on this as well The diff is not right since it will indicate that `Mod(var('e',even=True)/2,2)==0` but that should remain unevaluated. So check the math and assumptions, first. If there is any merit to this idea, go ahead and open a PR. Maybe this c...
2018-12-06T17:45:49Z
1.4
["test_Mod"]
["test_bug1", "test_Symbol", "test_arit0", "test_div", "test_pow", "test_pow2", "test_pow3", "test_mod_pow", "test_pow_E", "test_pow_issue_3516", "test_pow_im", "test_real_mul", "test_ncmul", "test_ncpow", "test_powerbug", "test_Mul_doesnt_expand_exp", "test_Add_Mul_is_integer", "test_Add_Mul_is_finite", "test_Mul_is_e...
73b3f90093754c5ed1561bd885242330e3583004
15 min - 1 hour
450
astropy/astropy
astropy__astropy-14309
cdb66059a2feb44ee49021874605ba90801f9986
diff --git a/astropy/io/fits/connect.py b/astropy/io/fits/connect.py --- a/astropy/io/fits/connect.py +++ b/astropy/io/fits/connect.py @@ -65,10 +65,9 @@ def is_fits(origin, filepath, fileobj, *args, **kwargs): fileobj.seek(pos) return sig == FITS_SIGNATURE elif filepath is not None: - if ...
diff --git a/astropy/io/fits/tests/test_connect.py b/astropy/io/fits/tests/test_connect.py --- a/astropy/io/fits/tests/test_connect.py +++ b/astropy/io/fits/tests/test_connect.py @@ -7,7 +7,14 @@ from astropy import units as u from astropy.io import fits -from astropy.io.fits import BinTableHDU, HDUList, ImageHDU, ...
IndexError: tuple index out of range in identify_format (io.registry) <!-- This comments are hidden when you submit the issue, so you do not need to remove them! --> <!-- Please be sure to check out our contributing guidelines, https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md . Please be sure to check...
cc @nstarman from #14274
2023-01-23T22:34:01Z
5.1
["astropy/io/fits/tests/test_connect.py::test_is_fits_gh_14305"]
["astropy/io/fits/tests/test_connect.py::TestSingleTable::test_simple", "astropy/io/fits/tests/test_connect.py::TestSingleTable::test_simple_pathlib", "astropy/io/fits/tests/test_connect.py::TestSingleTable::test_simple_meta", "astropy/io/fits/tests/test_connect.py::TestSingleTable::test_simple_meta_conflicting", "astr...
5f74eacbcc7fff707a44d8eb58adaa514cb7dcb5
<15 min fix
9
django/django
django__django-15503
859a87d873ce7152af73ab851653b4e1c3ffea4c
diff --git a/django/db/models/fields/json.py b/django/db/models/fields/json.py --- a/django/db/models/fields/json.py +++ b/django/db/models/fields/json.py @@ -172,6 +172,10 @@ def as_sql(self, compiler, connection): class HasKeyLookup(PostgresOperatorLookup): logical_operator = None + def compile_json_path_f...
diff --git a/tests/model_fields/test_jsonfield.py b/tests/model_fields/test_jsonfield.py --- a/tests/model_fields/test_jsonfield.py +++ b/tests/model_fields/test_jsonfield.py @@ -576,6 +576,33 @@ def test_has_any_keys(self): [self.objs[3], self.objs[4], self.objs[6]], ) + def test_has_key_num...
has_key, has_keys, and has_any_keys JSONField() lookups don't handle numeric keys on SQLite, MySQL, and Oracle. Description (last modified by TheTerrasque) Problem When using models.​JSONField() ​has_key lookup with numerical keys on SQLite database it fails to find the keys. Versions: Django: 4.0.3 Python: 3.9...
Duplicate of #30566, see comment. Not a duplicate of #30566 This is django's models.JSONField() not postgres extension JSONField It works as expected on Postgresql, the bug is on SQLite #30566 goes directly against comments for https://code.djangoproject.com/ticket/29504 If different behavior is expected on SQLite (or ...
2022-03-12T06:22:37Z
4.1
["test_has_key_number (model_fields.test_jsonfield.TestQuerying)", "test_has_keys (model_fields.test_jsonfield.TestQuerying)"]
["test_formfield (model_fields.test_jsonfield.TestFormField)", "test_formfield_custom_encoder_decoder (model_fields.test_jsonfield.TestFormField)", "test_custom_encoder (model_fields.test_jsonfield.TestValidation)", "test_invalid_decoder (model_fields.test_jsonfield.TestValidation)", "test_invalid_encoder (model_fields...
647480166bfe7532e8c471fef0146e3a17e6c0c9
1-4 hours
194
sphinx-doc/sphinx
sphinx-doc__sphinx-8551
57ed10c68057c96491acbd3e62254ccfaf9e3861
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -272,6 +272,8 @@ def make_xref(self, rolename: str, domain: str, target: str, result = super().make_xref(rolename, domain, target, # type: ignore ...
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -774,6 +774,53 @@ def test_pydecoratormethod_signature(app): assert domain.objects['deco'] == ('index', 'deco', 'method') +def test_info_field_list(app): + text = (".. py:module:: ex...
:type: and :rtype: gives false ambiguous class lookup warnings **Describe the bug** The implicit xrefs created by the info fields ``:type:`` and ``:rtype:`` seems to do lookup differently than explicit xref roles. For unqualified names it seems like they search for the name in every (sub)module instead of in the curre...
Also facing an issue similar to this. The other side of this issue is that you can also get a silently wrong cross-reference where a warning should have been issued instead: in some module, make a class, and then make one of these cross-references in non-module scope.
2020-12-19T09:34:31Z
3.4
["tests/test_domain_py.py::test_info_field_list"]
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_find_obj", "tests/test_domain_py.py::test_get_full_qualified_nam...
3f560cd67239f75840cc7a439ab54d8509c855f6
15 min - 1 hour
406
django/django
django__django-12663
fa5e7e46d875d4143510944f19d79df7b1739bab
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -233,7 +233,8 @@ def __init__(self, model, where=WhereNode, alias_cols=True): @property def output_field(self): if len(self.select) == 1: - ...
diff --git a/tests/expressions/models.py b/tests/expressions/models.py --- a/tests/expressions/models.py +++ b/tests/expressions/models.py @@ -6,10 +6,15 @@ from django.db import models +class Manager(models.Model): + name = models.CharField(max_length=50) + + class Employee(models.Model): firstname = mod...
Using SimpleLazyObject with a nested subquery annotation fails. Description (last modified by Jordan Ephron) Prior to 35431298226165986ad07e91f9d3aca721ff38ec it was possible to use a SimpleLazyObject in a queryset as demonstrated below. This new behavior appears to be a regression. Models from django.contrib.a...
I agree that this behavior was changed in 35431298226165986ad07e91f9d3aca721ff38ec, but you can easily create a test with SimpleLazyObject() (which is not a public API) and Subquery() that always fails with TypeError, e.g. def test_subquery_filter_by_lazy(self): test_user = SimpleLazyObject(lambda: get_user_model().obj...
2020-04-04T18:58:49Z
3.1
["test_subquery_filter_by_lazy (expressions.tests.BasicExpressionsTests)"]
["test_and (expressions.tests.CombinableTests)", "test_negation (expressions.tests.CombinableTests)", "test_or (expressions.tests.CombinableTests)", "test_reversed_and (expressions.tests.CombinableTests)", "test_reversed_or (expressions.tests.CombinableTests)", "test_deconstruct (expressions.tests.FTests)", "test_deepc...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
84
scikit-learn/scikit-learn
scikit-learn__scikit-learn-14983
06632c0d185128a53c57ccc73b25b6408e90bb89
diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -1163,6 +1163,9 @@ def get_n_splits(self, X=None, y=None, groups=None): **self.cvargs) return cv.get_n_splits(X, y, groups)...
diff --git a/sklearn/model_selection/tests/test_split.py b/sklearn/model_selection/tests/test_split.py --- a/sklearn/model_selection/tests/test_split.py +++ b/sklearn/model_selection/tests/test_split.py @@ -980,6 +980,17 @@ def test_repeated_cv_value_errors(): assert_raises(ValueError, cv, n_repeats=1.5) +...
RepeatedKFold and RepeatedStratifiedKFold do not show correct __repr__ string #### Description `RepeatedKFold` and `RepeatedStratifiedKFold` do not show correct \_\_repr\_\_ string. #### Steps/Code to Reproduce ```python >>> from sklearn.model_selection import RepeatedKFold, RepeatedStratifiedKFold >>> repr(...
The `__repr__` is not defined in the `_RepeatedSplit` class from which these cross-validation are inheriting. A possible fix should be: ```diff diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index ab681e89c..8a16f68bc 100644 --- a/sklearn/model_selection/_split.py +++ b/sklear...
2019-09-14T15:31:18Z
0.22
["sklearn/model_selection/tests/test_split.py::test_repeated_cv_repr[RepeatedKFold]", "sklearn/model_selection/tests/test_split.py::test_repeated_cv_repr[RepeatedStratifiedKFold]"]
["sklearn/model_selection/tests/test_split.py::test_cross_validator_with_default_params", "sklearn/model_selection/tests/test_split.py::test_2d_y", "sklearn/model_selection/tests/test_split.py::test_kfold_valueerrors", "sklearn/model_selection/tests/test_split.py::test_kfold_indices", "sklearn/model_selection/tests/tes...
7e85a6d1f038bbb932b36f18d75df6be937ed00d
<15 min fix
371
sphinx-doc/sphinx
sphinx-doc__sphinx-11510
6cb783c0024a873722952a67ebb9f41771c8eb6d
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -8,6 +8,7 @@ from docutils.parsers.rst.directives.admonitions import BaseAdmonition from docutils.parsers.rst.directives.misc import Class from docutils.parsers.rst.directives.mis...
diff --git a/tests/roots/test-directive-include/baz/baz.rst b/tests/roots/test-directive-include/baz/baz.rst new file mode 100644 --- /dev/null +++ b/tests/roots/test-directive-include/baz/baz.rst @@ -0,0 +1,6 @@ +Baz +=== + +.. include:: foo.rst + +Baz was here. \ No newline at end of file diff --git a/tests/roots/tes...
source-read event does not modify include'd files source ### Describe the bug In [Yocto documentation](https://git.yoctoproject.org/yocto-docs), we use a custom extension to do some search and replace in literal blocks, see https://git.yoctoproject.org/yocto-docs/tree/documentation/sphinx/yocto-vars.py. We discover...
Unfortunately, the `source-read` event does not support the `include` directive. So it will not be emitted on inclusion. >Note that the dumping docname and source[0] shows that the function actually gets called for something-to-include.rst file and its content is correctly replaced in source[0], it just does not mak...
2023-07-24T22:46:12Z
7.2
["tests/test_directive_other.py::test_include_source_read_event", "tests/test_directive_other.py::test_include_source_read_event_nested_includes"]
["tests/test_directive_other.py::test_toctree", "tests/test_directive_other.py::test_relative_toctree", "tests/test_directive_other.py::test_toctree_urls_and_titles", "tests/test_directive_other.py::test_toctree_glob", "tests/test_directive_other.py::test_toctree_glob_and_url", "tests/test_directive_other.py::test_reve...
7758e016231c3886e5a290c00fcb2c75d1f36c18
1-4 hours
388
sympy/sympy
sympy__sympy-24213
e8c22f6eac7314be8d92590bfff92ced79ee03e2
diff --git a/sympy/physics/units/unitsystem.py b/sympy/physics/units/unitsystem.py --- a/sympy/physics/units/unitsystem.py +++ b/sympy/physics/units/unitsystem.py @@ -175,7 +175,7 @@ def _collect_factor_and_dimension(self, expr): for addend in expr.args[1:]: addend_factor, addend_dim = \ ...
diff --git a/sympy/physics/units/tests/test_quantities.py b/sympy/physics/units/tests/test_quantities.py --- a/sympy/physics/units/tests/test_quantities.py +++ b/sympy/physics/units/tests/test_quantities.py @@ -561,6 +561,22 @@ def test_issue_24062(): exp_expr = 1 + exp(expr) assert SI._collect_factor_and_dim...
collect_factor_and_dimension does not detect equivalent dimensions in addition Code to reproduce: ```python from sympy.physics import units from sympy.physics.units.systems.si import SI v1 = units.Quantity('v1') SI.set_quantity_dimension(v1, units.velocity) SI.set_quantity_scale_factor(v1, 2 * units.meter / uni...
2022-11-03T14:00:09Z
1.12
["test_issue_24211"]
["test_str_repr", "test_eq", "test_convert_to", "test_Quantity_definition", "test_abbrev", "test_print", "test_Quantity_eq", "test_add_sub", "test_quantity_abs", "test_check_unit_consistency", "test_mul_div", "test_units", "test_issue_quart", "test_issue_5565", "test_find_unit", "test_Quantity_derivative", "test_quanti...
c6cb7c5602fa48034ab1bd43c2347a7e8488f12e
15 min - 1 hour
495
django/django
django__django-11095
7d49ad76562e8c0597a0eb66046ab423b12888d8
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -327,6 +327,10 @@ def get_fieldsets(self, request, obj=None): return self.fieldsets return [(None, {'fields': self.get_fields(request, obj)}...
diff --git a/tests/generic_inline_admin/tests.py b/tests/generic_inline_admin/tests.py --- a/tests/generic_inline_admin/tests.py +++ b/tests/generic_inline_admin/tests.py @@ -429,3 +429,29 @@ class EpisodeAdmin(admin.ModelAdmin): inlines = ma.get_inline_instances(request) for (formset, inline), other_...
add ModelAdmin.get_inlines() hook to allow set inlines based on the request or model instance. Description add ModelAdmin.get_inlines() hook to allow set inlines based on the request or model instance. Currently, We can override the method get_inline_instances to do such a thing, but a for loop should be copied to my...
Are you going to offer a patch to show exactly what you have in mind? I'm not immediately convinced that another hook is needed since the cost of duplicating a for loop is not that great. If I want to realize a dynamic inlines based on the request or model instance. I need to override get_inline_instances to do it. Wha...
2019-03-19T15:17:28Z
3.0
["test_get_inline_instances_override_get_inlines (generic_inline_admin.tests.GenericInlineModelAdminTest)"]
["test_no_deletion (generic_inline_admin.tests.NoInlineDeletionTest)", "test_custom_form_meta_exclude (generic_inline_admin.tests.GenericInlineModelAdminTest)", "test_custom_form_meta_exclude_with_readonly (generic_inline_admin.tests.GenericInlineModelAdminTest)", "test_get_fieldsets (generic_inline_admin.tests.Generic...
419a78300f7cd27611196e1e464d50fd0385ff27
15 min - 1 hour
30
pydata/xarray
pydata__xarray-6992
45c0a114e2b7b27b83c9618bc05b36afac82183c
diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -4026,10 +4026,11 @@ def set_index( dim_coords = either_dict_or_kwargs(indexes, indexes_kwargs, "set_index") new_indexes: dict[Hashable, Index] = {} - new_variables: dict[...
diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -2007,7 +2007,6 @@ def test_set_index(self) -> None: def test_reset_index(self) -> None: indexes = [self.mindex.get_level_values(n) for n in self.mindex...
index refactor: more `_coord_names` than `_variables` on Dataset ### What happened? `xr.core.dataset.DataVariables` assumes that everything that is in `ds._dataset._variables` and not in `self._dataset._coord_names` is a "data variable". However, since the index refactor we can end up with more `_coord_names` than `_v...
2022-09-05T15:07:43Z
2022.06
["xarray/tests/test_dataarray.py::TestDataArray::test_reset_index", "xarray/tests/test_dataset.py::TestDataset::test_reset_index", "xarray/tests/test_dataset.py::TestDataset::test_reset_index_drop_dims", "xarray/tests/test_dataset.py::TestDataset::test_reset_index_drop_convert[foo-False-dropped0-converted0-renamed0]", ...
["xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::TestDataArray...
50ea159bfd0872635ebf4281e741f3c87f0bef6b
>4 hours
316
sphinx-doc/sphinx
sphinx-doc__sphinx-8595
b19bce971e82f2497d67fdacdeca8db08ae0ba56
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -1074,7 +1074,7 @@ def get_module_members(self) -> Dict[str, ObjectMember]: def get_object_members(self, want_all: bool) -> Tuple[bool, ObjectMembers]: ...
diff --git a/tests/roots/test-ext-autodoc/target/empty_all.py b/tests/roots/test-ext-autodoc/target/empty_all.py new file mode 100644 --- /dev/null +++ b/tests/roots/test-ext-autodoc/target/empty_all.py @@ -0,0 +1,16 @@ +""" +docsting of empty_all module. +""" +__all__ = [] + + +def foo(): + """docstring""" + + +def...
autodoc: empty __all__ attribute is ignored **Describe the bug** autodoc: empty `__all__` attribute is ignored **To Reproduce** ``` # example.py __all__ = [] def foo(): "docstring" def bar(): "docstring" def baz(): "docstring" ``` ``` # index.rst .. automodule:: example :mem...
2020-12-27T03:07:50Z
3.5
["tests/test_ext_autodoc_automodule.py::test_empty_all"]
[]
4f8cb861e3b29186b38248fe81e4944fd987fcce
<15 min fix
408
sympy/sympy
sympy__sympy-23413
10de1a18a0efac0b19b611e40c928250dda688bf
diff --git a/sympy/polys/matrices/normalforms.py b/sympy/polys/matrices/normalforms.py --- a/sympy/polys/matrices/normalforms.py +++ b/sympy/polys/matrices/normalforms.py @@ -205,16 +205,19 @@ def _hermite_normal_form(A): if not A.domain.is_ZZ: raise DMDomainError('Matrix must be over domain ZZ.') # ...
diff --git a/sympy/matrices/tests/test_normalforms.py b/sympy/matrices/tests/test_normalforms.py --- a/sympy/matrices/tests/test_normalforms.py +++ b/sympy/matrices/tests/test_normalforms.py @@ -77,5 +77,11 @@ def test_hermite_normal(): assert hermite_normal_form(m) == hnf m = Matrix([[2, 7], [0, 0], [0, 0]...
bug with HNF removing rows I expect `np.flip (hermite_normal_form (Matrix (np.flip (np.array ([[5, 8, 12], [0, 0, 1]]))).T).T))` to give `[[5, 8, 0], [0, 0, 1]]` but instead I get `[[5, 8, 0]]` It seems to be falsely identifying my matrix as rank-deficient and removing the row when I try to achieve a row-style...
Seems to depend on where the 1 is when it comes to do the hnf: ```python >>> hermite_normal_form(Matrix([ # row2 ... [0, 12], ... [1, 8], ... [0, 5]])) Matrix([ [0, 12], [1, 0], [0, 5]]) >>> hermite_normal_form(Matrix([ # row3 ... [0, 12], ... [0, 8], ... [1, 5]])) Matrix([ [12, 0], [ 8, 0], [ ...
2022-04-23T23:40:41Z
1.11
["test_hermite_normal"]
["test_smith_normal", "test_smith_normal_deprecated"]
9a6104eab0ea7ac191a09c24f3e2d79dcd66bda5
15 min - 1 hour
490
sympy/sympy
sympy__sympy-23534
832c24fec1046eaa544a4cab4c69e3af3e651759
diff --git a/sympy/core/symbol.py b/sympy/core/symbol.py --- a/sympy/core/symbol.py +++ b/sympy/core/symbol.py @@ -791,7 +791,7 @@ def literal(s): return tuple(result) else: for name in names: - result.append(symbols(name, **args)) + result.append(symbols(name, cls=cls, **ar...
diff --git a/sympy/core/tests/test_symbol.py b/sympy/core/tests/test_symbol.py --- a/sympy/core/tests/test_symbol.py +++ b/sympy/core/tests/test_symbol.py @@ -1,3 +1,4 @@ +from sympy.core.function import Function, UndefinedFunction from sympy.core.numbers import (I, Rational, pi) from sympy.core.relational import (Gr...
Using symbols to create functions doesn't work if there is an extra layer of parentheses Sympy version == 1.10.1 Using `symbols` to create symbol-like objects like instances of `Function` as shown in the [documentation](https://docs.sympy.org/latest/modules/core.html?highlight=symbols#symbols) creates objects of cla...
2022-05-22T00:12:33Z
1.11
["test_symbols"]
["test_Str", "test_Symbol", "test_Dummy", "test_Dummy_force_dummy_index", "test_lt_gt", "test_no_len", "test_ineq_unequal", "test_Wild_properties", "test_symbols_become_functions_issue_3539", "test_unicode", "test_uniquely_named_symbol_and_Symbol"]
9a6104eab0ea7ac191a09c24f3e2d79dcd66bda5
<15 min fix
491
matplotlib/matplotlib
matplotlib__matplotlib-25775
26224d96066b5c60882296c551f54ca7732c0af0
diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -206,7 +206,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None): # space) in the following call to d...
diff --git a/lib/matplotlib/tests/test_text.py b/lib/matplotlib/tests/test_text.py --- a/lib/matplotlib/tests/test_text.py +++ b/lib/matplotlib/tests/test_text.py @@ -14,7 +14,7 @@ import matplotlib.transforms as mtransforms from matplotlib.testing.decorators import check_figures_equal, image_comparison from matplot...
[ENH]: Add get/set_antialiased to Text objects ### Problem Currently, Text objects always retrieve their antialiasing state via the global rcParams["text.antialias"], unlike other artists for which this can be configured on a per-artist basis via `set_antialiased` (and read via `set_antialiased`). ### Proposed soluti...
i would like to work on this issue .Please assign me this issue @ANSHTYAGI7 you are welcome to work on this issue, but we do not assign them. Based on my understanding, I found currently only AGG and Cairo backends support customizing font antialiasing. So we are going to add support for these two?
2023-04-26T21:26:46Z
3.7
["lib/matplotlib/tests/test_text.py::test_set_antialiased", "lib/matplotlib/tests/test_text.py::test_get_antialiased", "lib/matplotlib/tests/test_text.py::test_annotation_antialiased", "lib/matplotlib/tests/test_text.py::test_text_antialiased_off_default_vs_manual[png]", "lib/matplotlib/tests/test_text.py::test_text_an...
["lib/matplotlib/tests/test_text.py::test_font_styles[png]", "lib/matplotlib/tests/test_text.py::test_font_styles[pdf]", "lib/matplotlib/tests/test_text.py::test_multiline[png]", "lib/matplotlib/tests/test_text.py::test_multiline[pdf]", "lib/matplotlib/tests/test_text.py::test_multiline2[png]", "lib/matplotlib/tests/te...
0849036fd992a2dd133a0cffc3f84f58ccf1840f
15 min - 1 hour
280
scikit-learn/scikit-learn
scikit-learn__scikit-learn-12973
a7b8b9e9e16d4e15fabda5ae615086c2e1c47d8a
diff --git a/sklearn/linear_model/least_angle.py b/sklearn/linear_model/least_angle.py --- a/sklearn/linear_model/least_angle.py +++ b/sklearn/linear_model/least_angle.py @@ -1479,7 +1479,7 @@ def __init__(self, criterion='aic', fit_intercept=True, verbose=False, self.eps = eps self.fit_path = True ...
diff --git a/sklearn/linear_model/tests/test_least_angle.py b/sklearn/linear_model/tests/test_least_angle.py --- a/sklearn/linear_model/tests/test_least_angle.py +++ b/sklearn/linear_model/tests/test_least_angle.py @@ -18,7 +18,7 @@ from sklearn.utils.testing import TempMemmap from sklearn.exceptions import Convergen...
LassoLarsIC: unintuitive copy_X behaviour Hi, I would like to report what seems to be a bug in the treatment of the `copy_X` parameter of the `LassoLarsIC` class. Because it's a simple bug, it's much easier to see in the code directly than in the execution, so I am not posting steps to reproduce it. As you can see h...
2019-01-13T16:19:52Z
0.21
["sklearn/linear_model/tests/test_least_angle.py::test_lasso_lars_fit_copyX_behaviour[False]"]
["sklearn/linear_model/tests/test_least_angle.py::test_simple", "sklearn/linear_model/tests/test_least_angle.py::test_simple_precomputed", "sklearn/linear_model/tests/test_least_angle.py::test_all_precomputed", "sklearn/linear_model/tests/test_least_angle.py::test_lars_lstsq", "sklearn/linear_model/tests/test_least_ang...
7813f7efb5b2012412888b69e73d76f2df2b50b6
15 min - 1 hour
356
django/django
django__django-12262
69331bb851c34f05bc77e9fc24020fe6908b9cd5
diff --git a/django/template/library.py b/django/template/library.py --- a/django/template/library.py +++ b/django/template/library.py @@ -261,7 +261,7 @@ def parse_bits(parser, bits, params, varargs, varkw, defaults, if kwarg: # The kwarg was successfully extracted param, value = kwa...
diff --git a/tests/template_tests/templatetags/inclusion.py b/tests/template_tests/templatetags/inclusion.py --- a/tests/template_tests/templatetags/inclusion.py +++ b/tests/template_tests/templatetags/inclusion.py @@ -136,6 +136,15 @@ def inclusion_one_default(one, two='hi'): inclusion_one_default.anything = "Expecte...
Custom template tags raise TemplateSyntaxError when keyword-only arguments with defaults are provided. Description (last modified by P-Seebauer) When creating simple tags without variable keyword args, but an keyword argument with a default value. It's not possible to supply any other variable. @register.simple...
2019-12-30T13:13:59Z
3.1
["test_inclusion_tag_errors (template_tests.test_custom.InclusionTagTests)", "test_inclusion_tags (template_tests.test_custom.InclusionTagTests)", "test_simple_tag_errors (template_tests.test_custom.SimpleTagTests)", "test_simple_tags (template_tests.test_custom.SimpleTagTests)"]
["test_decorated_filter (template_tests.test_custom.CustomFilterTests)", "test_filter (template_tests.test_custom.CustomFilterTests)", "test_15070_use_l10n (template_tests.test_custom.InclusionTagTests)", "test_include_tag_missing_context (template_tests.test_custom.InclusionTagTests)", "test_inclusion_tag_registration...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
76
sympy/sympy
sympy__sympy-17630
58e78209c8577b9890e957b624466e5beed7eb08
diff --git a/sympy/matrices/expressions/matexpr.py b/sympy/matrices/expressions/matexpr.py --- a/sympy/matrices/expressions/matexpr.py +++ b/sympy/matrices/expressions/matexpr.py @@ -627,6 +627,8 @@ def _postprocessor(expr): # manipulate them like non-commutative scalars. return cls._f...
diff --git a/sympy/matrices/expressions/tests/test_blockmatrix.py b/sympy/matrices/expressions/tests/test_blockmatrix.py --- a/sympy/matrices/expressions/tests/test_blockmatrix.py +++ b/sympy/matrices/expressions/tests/test_blockmatrix.py @@ -3,7 +3,7 @@ BlockMatrix, bc_dist, bc_matadd, bc_transpose, bc_inverse, ...
Exception when multiplying BlockMatrix containing ZeroMatrix blocks When a block matrix with zero blocks is defined ``` >>> from sympy import * >>> a = MatrixSymbol("a", 2, 2) >>> z = ZeroMatrix(2, 2) >>> b = BlockMatrix([[a, z], [z, z]]) ``` then block-multiplying it once seems to work fine: ``` >>> blo...
2019-09-18T22:56:31Z
1.5
["test_issue_17624", "test_zero_matrix_add"]
["test_bc_matmul", "test_bc_matadd", "test_bc_transpose", "test_bc_dist_diag", "test_block_plus_ident", "test_BlockMatrix", "test_block_collapse_explicit_matrices", "test_BlockMatrix_trace", "test_BlockMatrix_Determinant", "test_squareBlockMatrix", "test_BlockDiagMatrix", "test_blockcut", "test_reblock_2x2", "test_debl...
70381f282f2d9d039da860e391fe51649df2779d
1-4 hours
461
sympy/sympy
sympy__sympy-24539
193e3825645d93c73e31cdceb6d742cc6919624d
diff --git a/sympy/polys/rings.py b/sympy/polys/rings.py --- a/sympy/polys/rings.py +++ b/sympy/polys/rings.py @@ -616,10 +616,13 @@ def set_ring(self, new_ring): return new_ring.from_dict(self, self.ring.domain) def as_expr(self, *symbols): - if symbols and len(symbols) != self.ring.ngens: -...
diff --git a/sympy/polys/tests/test_rings.py b/sympy/polys/tests/test_rings.py --- a/sympy/polys/tests/test_rings.py +++ b/sympy/polys/tests/test_rings.py @@ -259,11 +259,11 @@ def test_PolyElement_as_expr(): assert f != g assert f.as_expr() == g - X, Y, Z = symbols("x,y,z") - g = 3*X**2*Y - X*Y*Z + 7...
`PolyElement.as_expr()` not accepting symbols The method `PolyElement.as_expr()` https://github.com/sympy/sympy/blob/193e3825645d93c73e31cdceb6d742cc6919624d/sympy/polys/rings.py#L618-L624 is supposed to let you set the symbols you want to use, but, as it stands, either you pass the wrong number of symbols, and g...
2023-01-17T17:26:42Z
1.12
["test_PolyElement_as_expr"]
["test_PolyRing___init__", "test_PolyRing___hash__", "test_PolyRing___eq__", "test_PolyRing_ring_new", "test_PolyRing_drop", "test_PolyRing___getitem__", "test_PolyRing_is_", "test_PolyRing_add", "test_PolyRing_mul", "test_sring", "test_PolyElement___hash__", "test_PolyElement___eq__", "test_PolyElement__lt_le_gt_ge__"...
c6cb7c5602fa48034ab1bd43c2347a7e8488f12e
<15 min fix
497
django/django
django__django-15957
f387d024fc75569d2a4a338bfda76cc2f328f627
diff --git a/django/db/models/fields/related_descriptors.py b/django/db/models/fields/related_descriptors.py --- a/django/db/models/fields/related_descriptors.py +++ b/django/db/models/fields/related_descriptors.py @@ -64,8 +64,10 @@ class Child(Model): """ from django.core.exceptions import FieldError -from django...
diff --git a/tests/prefetch_related/tests.py b/tests/prefetch_related/tests.py --- a/tests/prefetch_related/tests.py +++ b/tests/prefetch_related/tests.py @@ -1908,3 +1908,67 @@ def test_nested_prefetch_is_not_overwritten_by_related_object(self): self.assertIs(Room.house.is_cached(self.room), True) wi...
Prefetch objects don't work with slices Description ​Prefetch() objects does not work with sliced querysets. For example the following code results in AssertionError: Cannot filter a query once a slice has been taken.: Category.objects.prefetch_related(Prefetch( 'post_set', queryset=Post.objects.all()[:3], to_attr...
It seems to me that #26565 ("Allow Prefetch query to use .values()") is related. Hi ludwik, #26565 is about a different issue. The only way we could support slices would be to extract it from the provided queryset to make it filterable again and apply it when in-memory joining. The prefect queryset would still have to ...
2022-08-13T06:18:25Z
4.2
["test_foreignkey_reverse (prefetch_related.tests.PrefetchLimitTests)", "test_m2m_forward (prefetch_related.tests.PrefetchLimitTests)", "test_m2m_reverse (prefetch_related.tests.PrefetchLimitTests)", "test_reverse_ordering (prefetch_related.tests.PrefetchLimitTests)"]
["The prefetched relationship is used rather than populating the reverse", "test_bug (prefetch_related.tests.Ticket19607Tests)", "When intermediary results are prefetched without a destination", "In-bulk does correctly prefetch objects by not using .iterator()", "test_prefetch_nullable (prefetch_related.tests.NullableT...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
1-4 hours
211
django/django
django__django-13158
7af8f4127397279d19ef7c7899e93018274e2f9b
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -305,6 +305,7 @@ def clone(self): obj.annotation_select_mask = None else: obj.annotation_select_mask = self.annotation_select_mask.copy...
diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py --- a/tests/queries/test_qs_combinators.py +++ b/tests/queries/test_qs_combinators.py @@ -51,6 +51,13 @@ def test_union_distinct(self): self.assertEqual(len(list(qs1.union(qs2, all=True))), 20) self.assertEqual(le...
QuerySet.none() on combined queries returns all results. Description I came across this issue on Stack Overflow. I'm not 100% sure it's a bug, but it does seem strange. With this code (excuse the bizarre example filtering): class Publication(models.Model): pass class Article(models.Model): publications = models.Man...
Thanks for the report. QuerySet.none() doesn't work properly on combined querysets, it returns all results instead of an empty queryset.
2020-07-06T19:18:11Z
3.2
["test_union_none (queries.test_qs_combinators.QuerySetSetOperationTests)"]
["test_combining_multiple_models (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_difference (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_intersection (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_union (queries.test_qs_combinators.QuerySetSetOperati...
65dfb06a1ab56c238cc80f5e1c31f61210c4577d
15 min - 1 hour
101
pytest-dev/pytest
pytest-dev__pytest-5631
cb828ebe70b4fa35cd5f9a7ee024272237eab351
diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -64,13 +64,18 @@ def num_mock_patch_args(function): patchings = getattr(function, "patchings", None) if not patchings: return 0 - mock_modules = [sys.modules.get("mock"), sys.modul...
diff --git a/testing/python/integration.py b/testing/python/integration.py --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -178,6 +178,34 @@ def test_hello_mock(self, abspath): reprec = testdir.inline_run() reprec.assertoutcome(passed=2) + def test_mock_sentinel_check_a...
ValueError when collecting tests that patch an array <!-- Thanks for submitting an issue! Here's a quick checklist for what to provide: --> I'm trying to run pytest with a test file that contains patch where "new" is an array, for example: from unittest.mock import patch @patch(target='XXXXXX', new=np.array(...
2019-07-19T20:13:12Z
5.0
["testing/python/integration.py::TestMockDecoration::test_mock_sentinel_check_against_numpy_like"]
["testing/python/integration.py::test_wrapped_getfslineno", "testing/python/integration.py::TestMockDecoration::test_wrapped_getfuncargnames", "testing/python/integration.py::TestMockDecoration::test_getfuncargnames_patching", "testing/python/integration.py::test_pytestconfig_is_session_scoped", "testing/python/integra...
c2f762460f4c42547de906d53ea498dd499ea837
15 min - 1 hour
334
sympy/sympy
sympy__sympy-20428
c0e85160406f9bf2bcaa2992138587668a1cd0bc
diff --git a/sympy/polys/domains/expressiondomain.py b/sympy/polys/domains/expressiondomain.py --- a/sympy/polys/domains/expressiondomain.py +++ b/sympy/polys/domains/expressiondomain.py @@ -120,7 +120,7 @@ def __ne__(f, g): return not f == g def __bool__(f): - return f.ex != 0 + ...
diff --git a/sympy/polys/tests/test_polytools.py b/sympy/polys/tests/test_polytools.py --- a/sympy/polys/tests/test_polytools.py +++ b/sympy/polys/tests/test_polytools.py @@ -1458,6 +1458,20 @@ def test_Poly_rat_clear_denoms(): assert f.rat_clear_denoms(g) == (f, g) +def test_issue_20427(): + f = Poly(-1179...
Result from clear_denoms() prints like zero poly but behaves wierdly (due to unstripped DMP) The was the immediate cause of the ZeroDivisionError in #17990. Calling `clear_denoms()` on a complicated constant poly that turns out to be zero: ``` >>> from sympy import * >>> x = symbols("x") >>> f = Poly(sympify("...
2020-11-14T05:56:31Z
1.8
["test_issue_20427"]
["test_Poly_mixed_operations", "test_Poly_from_dict", "test_Poly_from_list", "test_Poly_from_poly", "test_Poly_from_expr", "test_poly_from_domain_element", "test_Poly__new__", "test_Poly__args", "test_Poly__gens", "test_Poly_zero", "test_Poly_one", "test_Poly__unify", "test_Poly_free_symbols", "test_PurePoly_free_symbo...
3ac1464b8840d5f8b618a654f9fbf09c452fe969
15 min - 1 hour
475
pytest-dev/pytest
pytest-dev__pytest-5809
8aba863a634f40560e25055d179220f0eefabe9a
diff --git a/src/_pytest/pastebin.py b/src/_pytest/pastebin.py --- a/src/_pytest/pastebin.py +++ b/src/_pytest/pastebin.py @@ -77,11 +77,7 @@ def create_new_paste(contents): from urllib.request import urlopen from urllib.parse import urlencode - params = { - "code": contents, - "lex...
diff --git a/testing/test_pastebin.py b/testing/test_pastebin.py --- a/testing/test_pastebin.py +++ b/testing/test_pastebin.py @@ -126,7 +126,7 @@ def test_create_new_paste(self, pastebin, mocked_urlopen): assert len(mocked_urlopen) == 1 url, data = mocked_urlopen[0] assert type(data) is byte...
Lexer "python3" in --pastebin feature causes HTTP errors The `--pastebin` option currently submits the output of `pytest` to `bpaste.net` using `lexer=python3`: https://github.com/pytest-dev/pytest/blob/d47b9d04d4cf824150caef46c9c888779c1b3f58/src/_pytest/pastebin.py#L68-L73 For some `contents`, this will raise a "H...
2019-09-01T04:40:09Z
4.6
["testing/test_pastebin.py::TestPaste::test_create_new_paste"]
["testing/test_pastebin.py::TestPasteCapture::test_failed", "testing/test_pastebin.py::TestPasteCapture::test_all", "testing/test_pastebin.py::TestPasteCapture::test_non_ascii_paste_text"]
d5843f89d3c008ddcb431adbc335b080a79e617e
<15 min fix
336
sympy/sympy
sympy__sympy-13877
1659712001810f5fc563a443949f8e3bb38af4bd
diff --git a/sympy/matrices/matrices.py b/sympy/matrices/matrices.py --- a/sympy/matrices/matrices.py +++ b/sympy/matrices/matrices.py @@ -5,6 +5,7 @@ from sympy.core.add import Add from sympy.core.basic import Basic, Atom from sympy.core.expr import Expr +from sympy.core.function import expand_mul from sympy.core....
diff --git a/sympy/matrices/tests/test_matrices.py b/sympy/matrices/tests/test_matrices.py --- a/sympy/matrices/tests/test_matrices.py +++ b/sympy/matrices/tests/test_matrices.py @@ -402,6 +402,14 @@ def test_determinant(): assert M.det(method="bareiss") == z**2 - x*y assert M.det(method="berkowitz") == z**2 ...
Matrix determinant raises Invalid NaN comparison with particular symbolic entries >>> from sympy import * >>> from sympy.abc import a >>> f = lambda n: det(Matrix([[i + a*j for i in range(n)] for j in range(n)])) >>> f(1) 0 >>> f(2) -a >>> f(3) 2*a*(a + 2) + 2*a*(2*a + 1) - 3...
The source refers to a thesis that might justify a more general form of Bareiss algorithm, but I can't access the thesis. Meanwhile, the LU method works fine. ``` f = lambda n: Matrix([[i + a*j for i in range(n)] for j in range(n)]).det(method='lu') ``` Unless the failure of 'bareiss' here is due to an implementa...
2018-01-10T01:55:34Z
1.1
["test_determinant"]
["test_args", "test_sum", "test_abs", "test_addition", "test_fancy_index_matrix", "test_creation", "test_tolist", "test_as_mutable", "test_det_LU_decomposition", "test_slicing", "test_submatrix_assignment", "test_extract", "test_reshape", "test_random", "test_LUdecomp", "test_LUsolve", "test_matrix_inverse_mod", "test_...
ec9e3c0436fbff934fa84e22bf07f1b3ef5bfac3
15 min - 1 hour
440
django/django
django__django-14999
a754b82dac511475b6276039471ccd17cc64aeb8
diff --git a/django/db/migrations/operations/models.py b/django/db/migrations/operations/models.py --- a/django/db/migrations/operations/models.py +++ b/django/db/migrations/operations/models.py @@ -320,12 +320,13 @@ def database_forwards(self, app_label, schema_editor, from_state, to_state): new_model = to_st...
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -793,6 +793,28 @@ def test_rename_model_with_m2m(self): self.assertEqual(Rider.objects.count(), 2) self.assertEqual(Pony._meta.g...
RenameModel with db_table should be a noop. Description A RenameModel operation that already has db_table defined must be a noop. In Postgres, it drops and recreates foreign key constraints. In sqlite it recreates the table (as expected for a table renaming).
2021-10-16T09:31:21Z
4.1
["test_rename_model_with_db_table_noop (migrations.test_operations.OperationTests)"]
["test_references_model_mixin (migrations.test_operations.TestCreateModel)", "test_reference_field_by_through_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_from_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_name (migrations.test_operations.Fiel...
647480166bfe7532e8c471fef0146e3a17e6c0c9
<15 min fix
173
astropy/astropy
astropy__astropy-13236
6ed769d58d89380ebaa1ef52b300691eefda8928
diff --git a/astropy/table/table.py b/astropy/table/table.py --- a/astropy/table/table.py +++ b/astropy/table/table.py @@ -1239,13 +1239,6 @@ def _convert_data_to_col(self, data, copy=True, default_name=None, dtype=None, n f'{fully_qualified_name} ' 'did...
diff --git a/astropy/table/tests/test_mixin.py b/astropy/table/tests/test_mixin.py --- a/astropy/table/tests/test_mixin.py +++ b/astropy/table/tests/test_mixin.py @@ -697,11 +697,13 @@ def test_skycoord_representation(): '1.0,90.0,0.0'] -def test_ndarray_mixin(): +@pytest.mark.parametriz...
Consider removing auto-transform of structured column into NdarrayMixin <!-- This comments are hidden when you submit the issue, so you do not need to remove them! --> <!-- Please be sure to check out our contributing guidelines, https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md . Please be sure to che...
@mhvk - I'm happy to do this PR if you think it is a good idea. I agree there no longer is any reason to put structured arrays into `NdarrayMixin` -- indeed, I thought I had already changed its use! So, yes, happy to go ahead and create structured columns directly. So you think we should change it now, or do a release ...
2022-05-09T14:16:30Z
5.0
["astropy/table/tests/test_mixin.py::test_ndarray_mixin[False]", "astropy/table/tests/test_table.py::test_structured_masked_column"]
["astropy/table/tests/test_mixin.py::test_attributes[arrayswap]", "astropy/table/tests/test_mixin.py::test_attributes[arraywrap]", "astropy/table/tests/test_mixin.py::test_attributes[cartesianrep]", "astropy/table/tests/test_mixin.py::test_attributes[earthlocation]", "astropy/table/tests/test_mixin.py::test_attributes[...
cdf311e0714e611d48b0a31eb1f0e2cbffab7f23
15 min - 1 hour
2
pytest-dev/pytest
pytest-dev__pytest-5262
58e6a09db49f34886ff13f3b7520dd0bcd7063cd
diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -447,6 +447,10 @@ def name(self): """Ensure that file.name is a string.""" return repr(self.buffer) + @property + def mode(self): + return self.buffer.mode.replace("...
diff --git a/testing/test_capture.py b/testing/test_capture.py --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -1051,6 +1051,9 @@ def test_simple_resume_suspend(self, tmpfile): cap.done() pytest.raises(AttributeError, cap.suspend) + def test_capfd_sys_stdout_mode(self, capf...
_pytest.capture.EncodedFile mode should not include `b` (binary) <!-- Thanks for submitting an issue! Here's a quick checklist for what to provide: --> - [x] a detailed description of the bug or suggestion Exception when youtube-dl logs to pytest captured output. Youtube-dl looks for `b` in `out.mode` to dec...
here's where this comes from: https://github.com/pytest-dev/pytest/blob/6a43c8cd9405c68e223f4c6270bd1e1ac4bc8c5f/src/_pytest/capture.py#L450-L451 Probably an easy fix to ```python @property def mode(self): return self.buffer.mode.replace('b', '') ``` Want to supply a PR with a quick test demonstrating ...
2019-05-14T21:54:55Z
4.5
["testing/test_capture.py::TestFDCapture::test_capfd_sys_stdout_mode"]
["[100%]", "testing/test_capture.py::TestCaptureManager::test_getmethod_default_no_fd", "testing/test_capture.py::TestCaptureManager::test_capturing_basic_api[no]", "testing/test_capture.py::TestCaptureManager::test_capturing_basic_api[sys]", "testing/test_capture.py::TestCaptureManager::test_capturing_basic_api[fd]", ...
693c3b7f61d4d32f8927a74f34ce8ac56d63958e
<15 min fix
333
sphinx-doc/sphinx
sphinx-doc__sphinx-8621
21698c14461d27933864d73e6fba568a154e83b3
diff --git a/sphinx/builders/html/transforms.py b/sphinx/builders/html/transforms.py --- a/sphinx/builders/html/transforms.py +++ b/sphinx/builders/html/transforms.py @@ -37,7 +37,7 @@ class KeyboardTransform(SphinxPostTransform): """ default_priority = 400 builders = ('html',) - pattern = re.compile(...
diff --git a/tests/test_markup.py b/tests/test_markup.py --- a/tests/test_markup.py +++ b/tests/test_markup.py @@ -251,6 +251,17 @@ def get(name): '</kbd></p>'), '\\sphinxkeyboard{\\sphinxupquote{Control+X}}', ), + ( + # kbd role + 'verify', + ':kbd:`Alt+^`', + ('<...
kbd role produces incorrect HTML when compound-key separators (-, + or ^) are used as keystrokes **Describe the bug** The `:kbd:` role produces incorrect HTML when: 1) defining standalone keystrokes that use any of the compound-key separators (`-`, `+` and `^`) 2) defining compound keystrokes where one or more k...
2020-12-30T12:13:09Z
3.5
["tests/test_markup.py::test_inline[verify-:kbd:`Alt+^`-<p><kbd", "tests/test_markup.py::test_inline[verify-:kbd:`-`-<p><kbd"]
["tests/test_markup.py::test_inline[verify-:rfc:`2324`-<p><span", "tests/test_markup.py::test_inline[verify-:rfc:`2324#id1`-<p><span", "tests/test_markup.py::test_inline[verify_re-``code", "tests/test_markup.py::test_inline[verify-:menuselection:`a", "tests/test_markup.py::test_inline[verify-:menuselection:`&Foo", "tes...
4f8cb861e3b29186b38248fe81e4944fd987fcce
<15 min fix
409
django/django
django__django-12050
b93a0e34d9b9b99d41103782b7e7aeabf47517e3
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1059,21 +1059,10 @@ def resolve_lookup_value(self, value, can_reuse, allow_joins, simple_col): elif isinstance(value, (list, tuple)): # The items o...
diff --git a/tests/queries/test_query.py b/tests/queries/test_query.py --- a/tests/queries/test_query.py +++ b/tests/queries/test_query.py @@ -113,3 +113,10 @@ def test_clone_select_related(self): clone = query.clone() clone.add_select_related(['note', 'creator__extra']) self.assertEqual(quer...
Query.resolve_lookup_value coerces value of type list to tuple Description Changes introduced in #30687 cause an input value list to be coerced to tuple breaking exact value queries. This affects ORM field types that are dependent on matching input types such as PickledField. The expected iterable return type should ...
2019-11-10T08:53:45Z
3.1
["test_iterable_lookup_value (queries.test_query.TestQuery)"]
["test_clone_select_related (queries.test_query.TestQuery)", "test_complex_query (queries.test_query.TestQuery)", "test_foreign_key (queries.test_query.TestQuery)", "test_foreign_key_exclusive (queries.test_query.TestQuery)", "test_foreign_key_f (queries.test_query.TestQuery)", "test_multiple_fields (queries.test_query...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
70
django/django
django__django-15916
88e67a54b7ed0210c11523a337b498aadb2f5187
diff --git a/django/forms/models.py b/django/forms/models.py --- a/django/forms/models.py +++ b/django/forms/models.py @@ -253,18 +253,11 @@ def __init__(self, options=None): self.help_texts = getattr(options, "help_texts", None) self.error_messages = getattr(options, "error_messages", None) ...
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -3496,6 +3496,41 @@ class InheritedForm(NewForm): type(NewForm.base_fields[name].widget), ) + def test_custom_callback_in_meta(self): + def ...
Allow ModelForm meta to specify formfield_callback. Description (last modified by Klaas-Jan Gorter) The function django.forms.modelform_factory returns a form class based on the class it recieves as form argument. As an additional argument it accepts a formfield_callback function. When no callback is provided t...
I was always the impression that formfield_callback was solely an allowed kwarg of the modelform_factory function and its friends. I believe this test has been removed from version 2, because I find no equivalent test in tests/model_formsets_regress. From what I can see the patch from #18573 was never committed and thu...
2022-08-04T18:59:18Z
4.2
["test_custom_callback_from_base_form_meta (model_forms.tests.FormFieldCallbackTests)", "test_custom_callback_in_meta (model_forms.tests.FormFieldCallbackTests)"]
["test_modelform_factory_metaclass (model_forms.tests.CustomMetaclassTestCase)", "Regression test for #12960. Make sure the cleaned_data returned from", "Regression for #12596: Calling super from ModelForm.clean() should be", "test_bad_callback (model_forms.tests.FormFieldCallbackTests)", "Using base forms with widgets...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
15 min - 1 hour
209
django/django
django__django-11848
f0adf3b9b7a19cdee05368ff0c0c2d087f011180
diff --git a/django/utils/http.py b/django/utils/http.py --- a/django/utils/http.py +++ b/django/utils/http.py @@ -176,10 +176,14 @@ def parse_http_date(date): try: year = int(m.group('year')) if year < 100: - if year < 70: - year += 2000 + current_year = date...
diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py --- a/tests/utils_tests/test_http.py +++ b/tests/utils_tests/test_http.py @@ -1,5 +1,6 @@ import unittest from datetime import datetime +from unittest import mock from django.test import SimpleTestCase, ignore_warnings from django.utils....
django.utils.http.parse_http_date two digit year check is incorrect Description (last modified by Ad Timmering) RFC 850 does not mention this, but in RFC 7231 (and there's something similar in RFC 2822), there's the following quote: Recipients of a timestamp value in rfc850-date format, which uses a two-digit y...
Accepted, however I don't think your patch is correct. The check should be relative to the current year, if I read the RFC quote correctly. Created a pull request: Created a pull request: ​https://github.com/django/django/pull/9214 Still some suggested edits on the PR. I added regression test that fails with old code (...
2019-09-28T04:28:22Z
3.1
["test_parsing_rfc850 (utils_tests.test_http.HttpDateProcessingTests)", "test_parsing_year_less_than_70 (utils_tests.test_http.HttpDateProcessingTests)"]
["test_input_too_large (utils_tests.test_http.Base36IntTests)", "test_invalid_literal (utils_tests.test_http.Base36IntTests)", "test_negative_input (utils_tests.test_http.Base36IntTests)", "test_roundtrip (utils_tests.test_http.Base36IntTests)", "test_to_base36_errors (utils_tests.test_http.Base36IntTests)", "test_to_i...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
63
sphinx-doc/sphinx
sphinx-doc__sphinx-10466
cab2d93076d0cca7c53fac885f927dde3e2a5fec
diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -57,7 +57,8 @@ def add(self, msg: str, origin: Union[Element, "MsgOrigin"]) -> None: def __iter__(self) -> Generator[Message, None, None]: for message in self.message...
diff --git a/tests/test_build_gettext.py b/tests/test_build_gettext.py --- a/tests/test_build_gettext.py +++ b/tests/test_build_gettext.py @@ -8,9 +8,29 @@ import pytest +from sphinx.builders.gettext import Catalog, MsgOrigin from sphinx.util.osutil import cd +def test_Catalog_duplicated_message(): + catal...
Message.locations duplicate unnecessary ### Describe the bug When running `make clean; make gettext` there are times the list of locations is duplicated unnecessarily, example: ``` #: ../../manual/render/shader_nodes/vector/vector_rotate.rst:38 #: ../../manual/modeling/hair.rst:0 #: ../../manual/modelin...
Just to add to the part of the solution. The `self.locations = list(set(locations)) ` in the __init__ method of gettext.py is NOT enough. The `def __iter__(self) -> Generator[Message, None, None]:` needed to have this as well: `positions = [(os.path.relpath(source, start=os.getcwd()), line) for source,...
2022-05-22T16:46:53Z
5.0
["tests/test_build_gettext.py::test_Catalog_duplicated_message"]
["tests/test_build_gettext.py::test_build_gettext", "tests/test_build_gettext.py::test_gettext_index_entries", "tests/test_build_gettext.py::test_gettext_disable_index_entries", "tests/test_build_gettext.py::test_gettext_template", "tests/test_build_gettext.py::test_gettext_template_msgid_order_in_sphinxpot", "tests/te...
60775ec4c4ea08509eee4b564cbf90f316021aff
15 min - 1 hour
384
django/django
django__django-13023
f83b44075dafa429d59e8755aa47e15577cc49f9
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -1501,7 +1501,7 @@ def to_python(self, value): return self.context.create_decimal_from_float(value) try: return...
diff --git a/tests/model_fields/test_decimalfield.py b/tests/model_fields/test_decimalfield.py --- a/tests/model_fields/test_decimalfield.py +++ b/tests/model_fields/test_decimalfield.py @@ -21,9 +21,24 @@ def test_to_python(self): # Uses default rounding of ROUND_HALF_EVEN. self.assertEqual(f.to_pyth...
DecimalField.to_python() raises TypeError on dict values. Description A call to DecimalField.to_python() with a dictionary as the value parameter produces TypeError instead of ValidationError. This is a problem, for example, when you try to save a model object, and a decimal field got set to a dictionary by mistake. ...
2020-06-04T20:40:44Z
3.2
["test_invalid_value (model_fields.test_decimalfield.DecimalFieldTests)", "test_lookup_really_big_value (model_fields.test_decimalfield.DecimalFieldTests)"]
["test_default (model_fields.test_decimalfield.DecimalFieldTests)", "test_filter_with_strings (model_fields.test_decimalfield.DecimalFieldTests)", "test_get_prep_value (model_fields.test_decimalfield.DecimalFieldTests)", "test_max_decimal_places_validation (model_fields.test_decimalfield.DecimalFieldTests)", "test_max_...
65dfb06a1ab56c238cc80f5e1c31f61210c4577d
<15 min fix
93
sympy/sympy
sympy__sympy-22080
3f8c8c2377cb8e0daaf8073e8d03ac7d87580813
diff --git a/sympy/printing/codeprinter.py b/sympy/printing/codeprinter.py --- a/sympy/printing/codeprinter.py +++ b/sympy/printing/codeprinter.py @@ -9,7 +9,7 @@ from sympy.core.mul import _keep_coeff from sympy.core.symbol import Symbol from sympy.printing.str import StrPrinter -from sympy.printing.precedence impo...
diff --git a/sympy/codegen/tests/test_rewriting.py b/sympy/codegen/tests/test_rewriting.py --- a/sympy/codegen/tests/test_rewriting.py +++ b/sympy/codegen/tests/test_rewriting.py @@ -266,10 +266,10 @@ def test_create_expand_pow_optimization(): # gh issue 15335 assert cc(x**(-4)) == '1.0/(x*x*x*x)' assert...
Mod function lambdify bug Description: When lambdifying any function of structure like `expr * Mod(a, b)` sympy moves the multiplier into the first argument of Mod, like `Mod(expr * a, b)`, WHEN we specify `modules=[]` This is an example from Sympy online shell ``` >>> from sympy import Mod, lambdify, symbols >>...
Looks like the printer has the precedence order wrong for - and % A more direct reproduction ```py >>> pycode(-Mod(x, y)) '-x % y' ``` hi @asmeurer i should i please take this up !! please do reply .. thanks:-) Hello anyone working on this?? I would like to help. I want to contribute on this issue. Is this...
2021-09-12T07:11:33Z
1.10
["test_create_expand_pow_optimization", "test_PythonCodePrinter", "test_empty_modules"]
["test_log2_opt", "test_exp2_opt", "test_expm1_opt", "test_expm1_two_exp_terms", "test_cosm1_opt", "test_cosm1_two_cos_terms", "test_expm1_cosm1_mixed", "test_log1p_opt", "test_optims_c99", "test_matsolve", "test_logaddexp_opt", "test_logaddexp2_opt", "test_sinc_opts", "test_optims_numpy", "test_PythonCodePrinter_stand...
fd40404e72921b9e52a5f9582246e4a6cd96c431
15 min - 1 hour
485
django/django
django__django-15278
0ab58c120939093fea90822f376e1866fc714d1f
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py --- a/django/db/backends/sqlite3/schema.py +++ b/django/db/backends/sqlite3/schema.py @@ -324,10 +324,15 @@ def delete_model(self, model, handle_autom2m=True): def add_field(self, model, field): """Create a field on...
diff --git a/tests/schema/tests.py b/tests/schema/tests.py --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -624,6 +624,18 @@ def get_prep_value(self, value): # Make sure the values were transformed correctly self.assertEqual(Author.objects.extra(where=["thing = 1"]).count(), 2) + def t...
Adding nullable OneToOneField crashes on SQLite. Description This new sqlite3 error has cropped up between building django-oauth-toolkit between Django 4.0 and main branch for migrations.AddField of a OneToOneField (see ​https://github.com/jazzband/django-oauth-toolkit/issues/1064): self = <django.db.backends.sqlite3...
Thanks for the report! Regression in 2f73e5406d54cb8945e187eff302a3a3373350be.
2022-01-03T20:01:32Z
4.1
["test_add_field_o2o_nullable (schema.tests.SchemaTests)"]
["effective_default() should be used for DateField, DateTimeField, and", "Tests adding fields to models", "Tests binary fields get a sane default (#22851)", "test_add_field_db_collation (schema.tests.SchemaTests)", "test_add_field_default_dropped (schema.tests.SchemaTests)", "test_add_field_default_nullable (schema.tes...
647480166bfe7532e8c471fef0146e3a17e6c0c9
15 min - 1 hour
185
django/django
django__django-11133
879cc3da6249e920b8d54518a0ae06de835d7373
diff --git a/django/http/response.py b/django/http/response.py --- a/django/http/response.py +++ b/django/http/response.py @@ -229,7 +229,7 @@ def make_bytes(self, value): # Handle string types -- we can't rely on force_bytes here because: # - Python attempts str conversion first # - when sel...
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -366,6 +366,10 @@ def test_non_string_content(self): r.content = 12345 self.assertEqual(r.content, b'12345') + def test_memoryview_content(self): + ...
HttpResponse doesn't handle memoryview objects Description I am trying to write a BinaryField retrieved from the database into a HttpResponse. When the database is Sqlite this works correctly, but Postgresql returns the contents of the field as a memoryview object and it seems like current Django doesn't like this co...
I guess HttpResponseBase.make_bytes ​could be adapted to deal with memoryview objects by casting them to bytes. In all cases simply wrapping the memoryview in bytes works as a workaround HttpResponse(bytes(model.binary_field)). The fact make_bytes would still use force_bytes if da56e1bac6449daef9aeab8d076d2594d9fd5b44 ...
2019-03-27T06:48:09Z
3.0
["test_memoryview_content (httpwrappers.tests.HttpResponseTests)"]
["test_streaming_response (httpwrappers.tests.StreamingHttpResponseTests)", "test_cookie_edgecases (httpwrappers.tests.CookieTests)", "Semicolons and commas are decoded.", "Semicolons and commas are encoded.", "test_httponly_after_load (httpwrappers.tests.CookieTests)", "test_invalid_cookies (httpwrappers.tests.CookieT...
419a78300f7cd27611196e1e464d50fd0385ff27
<15 min fix
33
django/django
django__django-12273
927c903f3cd25c817c21738328b53991c035b415
diff --git a/django/db/models/base.py b/django/db/models/base.py --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -569,6 +569,9 @@ def _get_pk_val(self, meta=None): return getattr(self, meta.pk.attname) def _set_pk_val(self, value): + for parent_link in self._meta.parents.values()...
diff --git a/tests/model_inheritance_regress/tests.py b/tests/model_inheritance_regress/tests.py --- a/tests/model_inheritance_regress/tests.py +++ b/tests/model_inheritance_regress/tests.py @@ -10,10 +10,11 @@ from .models import ( ArticleWithAuthor, BachelorParty, BirthdayParty, BusStation, Child, - Derive...
Resetting primary key for a child model doesn't work. Description In the attached example code setting the primary key to None does not work (so that the existing object is overwritten on save()). The most important code fragments of the bug example: from django.db import models class Item(models.Model): # uid = mod...
I'm not sure if this is a bug. The test passes after adding self.item_ptr = None to Item.reset(). Is that the behavior you're looking for? I agree with Tim here. It feels like what you're after is self.pk = None as it will be alias for self.item_ptr for Derived instances and self.uid for Item instances. @Simon Charette...
2020-01-03T18:47:56Z
3.1
["test_create_new_instance_with_pk_equals_none (model_inheritance_regress.tests.ModelInheritanceTest)", "test_create_new_instance_with_pk_equals_none_multi_inheritance (model_inheritance_regress.tests.ModelInheritanceTest)"]
["test_abstract_base_class_m2m_relation_inheritance (model_inheritance_regress.tests.ModelInheritanceTest)", "test_abstract_verbose_name_plural_inheritance (model_inheritance_regress.tests.ModelInheritanceTest)", "test_all_fields_from_abstract_base_class (model_inheritance_regress.tests.ModelInheritanceTest)", "test_co...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
77
astropy/astropy
astropy__astropy-12907
d16bfe05a744909de4b27f5875fe0d4ed41ce607
diff --git a/astropy/modeling/separable.py b/astropy/modeling/separable.py --- a/astropy/modeling/separable.py +++ b/astropy/modeling/separable.py @@ -242,7 +242,7 @@ def _cstack(left, right): cright = _coord_matrix(right, 'right', noutp) else: cright = np.zeros((noutp, right.shape[1])) - ...
diff --git a/astropy/modeling/tests/test_separable.py b/astropy/modeling/tests/test_separable.py --- a/astropy/modeling/tests/test_separable.py +++ b/astropy/modeling/tests/test_separable.py @@ -28,6 +28,13 @@ p1 = models.Polynomial1D(1, name='p1') +cm_4d_expected = (np.array([False, False, True, True]), + ...
Modeling's `separability_matrix` does not compute separability correctly for nested CompoundModels Consider the following model: ```python from astropy.modeling import models as m from astropy.modeling.separable import separability_matrix cm = m.Linear1D(10) & m.Linear1D(5) ``` It's separability matrix as y...
2022-03-03T15:14:54Z
4.3
["astropy/modeling/tests/test_separable.py::test_separable[compound_model6-result6]", "astropy/modeling/tests/test_separable.py::test_separable[compound_model9-result9]"]
["astropy/modeling/tests/test_separable.py::test_coord_matrix", "astropy/modeling/tests/test_separable.py::test_cdot", "astropy/modeling/tests/test_separable.py::test_cstack", "astropy/modeling/tests/test_separable.py::test_arith_oper", "astropy/modeling/tests/test_separable.py::test_separable[compound_model0-result0]"...
298ccb478e6bf092953bca67a3d29dc6c35f6752
15 min - 1 hour
0
astropy/astropy
astropy__astropy-14369
fa4e8d1cd279acf9b24560813c8652494ccd5922
diff --git a/astropy/units/format/cds.py b/astropy/units/format/cds.py --- a/astropy/units/format/cds.py +++ b/astropy/units/format/cds.py @@ -138,8 +138,7 @@ def _make_parser(cls): for Astronomical Catalogues 2.0 <http://vizier.u-strasbg.fr/vizier/doc/catstd-3.2.htx>`_, which is not terribly...
diff --git a/astropy/units/tests/test_format.py b/astropy/units/tests/test_format.py --- a/astropy/units/tests/test_format.py +++ b/astropy/units/tests/test_format.py @@ -60,9 +60,13 @@ def test_unit_grammar_fail(string): (["mW/m2"], u.Unit(u.erg / u.cm**2 / u.s)), (["mW/(m2)"], u.Unit(u.erg / u.cm**2...
Incorrect units read from MRT (CDS format) files with astropy.table ### Description When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be...
Welcome to Astropy 👋 and thank you for your first issue! A project member will respond to you as soon as possible; in the meantime, please double-check the [guidelines for submitting issues](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested deta...
2023-02-06T21:56:51Z
5.1
["astropy/units/tests/test_format.py::test_cds_grammar[strings4-unit4]", "astropy/units/tests/test_format.py::test_cds_grammar[strings6-unit6]", "astropy/units/tests/test_format.py::test_cds_grammar_fail[km/s.Mpc-1]"]
["astropy/units/tests/test_format.py::test_unit_grammar[strings0-unit0]", "astropy/units/tests/test_format.py::test_unit_grammar[strings1-unit1]", "astropy/units/tests/test_format.py::test_unit_grammar[strings2-unit2]", "astropy/units/tests/test_format.py::test_unit_grammar[strings3-unit3]", "astropy/units/tests/test_f...
5f74eacbcc7fff707a44d8eb58adaa514cb7dcb5
1-4 hours
11
sphinx-doc/sphinx
sphinx-doc__sphinx-9281
8ec06e9a1bd862cd713b9db748e039ccc7b3e15b
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -442,14 +442,14 @@ def object_description(object: Any) -> str: (object_description(key), object_description(object[key])) for key in sorted_keys) ...
diff --git a/tests/test_util_inspect.py b/tests/test_util_inspect.py --- a/tests/test_util_inspect.py +++ b/tests/test_util_inspect.py @@ -10,6 +10,7 @@ import ast import datetime +import enum import functools import sys import types @@ -516,6 +517,14 @@ def __repr__(self): assert "<CustomType(2)>: 2" in de...
Python Enum values (used to show default values in function signatures) are rendered ugly. Python Enum values (used to show default values in function signatures) are rendered ugly. **To Reproduce** I made a minimal example to show the issue: https://github.com/sidneycadot/sphinx_issue_ugly_enum ``` $ git ...
Probably the repr() representation of default arguments is used, and it should be; that is supposed to give a string that, when evaluated, yields the value. Unfortunately, the enum.Enum implementation in Python does not honor this convention; their repr() includes the Enum value and the "<>" brackets. In an ideal...
2021-05-29T17:16:30Z
4.1
["tests/test_util_inspect.py::test_object_description_enum"]
["tests/test_util_inspect.py::test_TypeAliasNamespace", "tests/test_util_inspect.py::test_signature", "tests/test_util_inspect.py::test_signature_partial", "tests/test_util_inspect.py::test_signature_methods", "tests/test_util_inspect.py::test_signature_partialmethod", "tests/test_util_inspect.py::test_signature_annota...
9a2c3c4a1559e37e95fdee88c128bb116642c897
<15 min fix
415
django/django
django__django-10097
b9cf764be62e77b4777b3a75ec256f6209a57671
diff --git a/django/core/validators.py b/django/core/validators.py --- a/django/core/validators.py +++ b/django/core/validators.py @@ -94,7 +94,7 @@ class URLValidator(RegexValidator): regex = _lazy_re_compile( r'^(?:[a-z0-9\.\-\+]*)://' # scheme is validated separately - r'(?:\S+(?::\S*)?@)?' ...
diff --git a/tests/validators/invalid_urls.txt b/tests/validators/invalid_urls.txt --- a/tests/validators/invalid_urls.txt +++ b/tests/validators/invalid_urls.txt @@ -57,3 +57,9 @@ http://example.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. http://example.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
Make URLValidator reject invalid characters in the username and password Description (last modified by Tim Bell) Since #20003, core.validators.URLValidator accepts URLs with usernames and passwords. RFC 1738 section 3.1 requires "Within the user and password field, any ":", "@", or "/" must be encoded"; however...
2018-06-26T23:30:51Z
2.2
["test_ascii_validator (auth_tests.test_validators.UsernameValidatorsTests)", "test_unicode_validator (auth_tests.test_validators.UsernameValidatorsTests)", "test_help_text (auth_tests.test_validators.UserAttributeSimilarityValidatorTest)", "test_validate (auth_tests.test_validators.UserAttributeSimilarityValidatorTest...
["test_defaults (str.tests.SimpleTests)", "test_international (str.tests.SimpleTests)", "test_default (model_fields.test_decimalfield.DecimalFieldTests)", "test_filter_with_strings (model_fields.test_decimalfield.DecimalFieldTests)", "test_get_prep_value (model_fields.test_decimalfield.DecimalFieldTests)", "test_lookup...
4fc35a9c3efdc9154efce28cb23cb84f8834517e
<15 min fix
22
django/django
django__django-12143
5573a54d409bb98b5c5acdb308310bed02d392c2
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -1631,7 +1631,9 @@ def change_view(self, request, object_id, form_url='', extra_context=None): def _get_edited_object_pks(self, request, prefix): ...
diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -844,6 +844,26 @@ def test_get_list_editable_queryset(self): queryset = m._get_list_editable_queryset(request, prefix='form') self.assertEqual(q...
Possible data loss in admin changeform view when using regex special characters in formset prefix Description (last modified by Baptiste Mispelon) While browsing the code in admin/options.py [1] (working on an unrelated ticket), I came across that line: pk_pattern = re.compile(r'{}-\d+-{}$'.format(prefix, self....
2019-11-25T14:38:30Z
3.1
["test_get_list_editable_queryset_with_regex_chars_in_prefix (admin_changelist.tests.ChangeListTests)"]
["test_custom_user_pk_not_named_id (admin_changelist.tests.GetAdminLogTests)", "test_missing_args (admin_changelist.tests.GetAdminLogTests)", "{% get_admin_log %} works without specifying a user.", "test_non_integer_limit (admin_changelist.tests.GetAdminLogTests)", "test_without_as (admin_changelist.tests.GetAdminLogTe...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
72
django/django
django__django-15252
361bb8f786f112ee275be136795c0b1ecefff928
diff --git a/django/db/migrations/executor.py b/django/db/migrations/executor.py --- a/django/db/migrations/executor.py +++ b/django/db/migrations/executor.py @@ -96,8 +96,12 @@ def migrate(self, targets, plan=None, state=None, fake=False, fake_initial=False (un)applied and in a second step run all the databas...
diff --git a/tests/backends/base/test_creation.py b/tests/backends/base/test_creation.py --- a/tests/backends/base/test_creation.py +++ b/tests/backends/base/test_creation.py @@ -57,12 +57,12 @@ def test_custom_test_name_with_test_prefix(self): @mock.patch.object(connection, 'ensure_connection') @mock.patch.object(co...
MigrationRecorder does not obey db_router allow_migrate rules Description Hi, We have a multi-db setup. We have one connection that is for the django project, and several connections that talk to other dbs for information (ie models with managed = False). Django should only create tables in the first connection, neve...
I don't think you've implemented your router correctly, but I'd need to check the router code to see if it's called multiple times (num_dbs*num_models) to be sure. This is how we implement our routers for allow_migrate: def allow_migrate(self, db, model): if db == 'other': return model._meta.app_label == 'legacy_app' #...
2021-12-28T15:51:06Z
4.1
["test_migrate_test_setting_false_ensure_schema (backends.base.test_creation.TestDbCreationTests)", "The django_migrations table is not created if there are no migrations"]
["test_mark_expected_failures_and_skips (backends.base.test_creation.TestMarkTests)", "test_custom_test_name (backends.base.test_creation.TestDbSignatureTests)", "test_custom_test_name_with_test_prefix (backends.base.test_creation.TestDbSignatureTests)", "test_default_name (backends.base.test_creation.TestDbSignatureTe...
647480166bfe7532e8c471fef0146e3a17e6c0c9
15 min - 1 hour
182
django/django
django__django-13820
98ad327864aed8df245fd19ea9d2743279e11643
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -88,15 +88,19 @@ def load_disk(self): continue raise else: - # Empty directories are namespaces. - ...
diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py --- a/tests/migrations/test_loader.py +++ b/tests/migrations/test_loader.py @@ -1,5 +1,6 @@ import compileall import os +from importlib import import_module from django.db import connection, connections from django.db.migrations.except...
Permit migrations in non-namespace packages that don't have __file__ Description Summary This feature request, for which I will post a PR shortly, aims to improve the specificity of the migration loader's check for and rejection of ​PEP-420 namespace packages. I am NOT asking to allow namespace packages for apps' mig...
2020-12-28T22:07:57Z
3.2
["test_loading_package_without__file__ (migrations.test_loader.LoaderTests)"]
["test_apply (migrations.test_loader.RecorderTests)", "test_invalid (migrations.test_loader.PycLoaderTests)", "test_valid (migrations.test_loader.PycLoaderTests)", "test_check_consistent_history (migrations.test_loader.LoaderTests)", "test_check_consistent_history_squashed (migrations.test_loader.LoaderTests)", "test_e...
65dfb06a1ab56c238cc80f5e1c31f61210c4577d
15 min - 1 hour
131
sphinx-doc/sphinx
sphinx-doc__sphinx-8638
4b452338f914d4f6b54704222d70ae8a746e3db5
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -354,7 +354,7 @@ class PyObject(ObjectDescription): 'keyword', 'kwarg', 'kwparam'), typerolename='class', typenames=('paramtype', 'type'), ...
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -838,6 +838,30 @@ def test_info_field_list(app): **{"py:module": "example", "py:class": "Class"}) +def test_info_field_list_var(app): + text = (".. py:class:: Class\n" + ...
Instance variables link to other variables of the same name in the project **Describe the bug** Assume autodoc is used via apidoc. In theory other combinations of autodoc (or maybe even without it) can cause this to occur, but this would be the most common occurrence. If a global variable (or really, any kind of va...
2021-01-01T13:54:38Z
4.0
["tests/test_domain_py.py::test_info_field_list_var"]
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_find_obj", "tests/test_domain_py.py::test_get_full_qualified_nam...
8939a75efaa911a12dbe6edccedf261e88bf7eef
15 min - 1 hour
410
django/django
django__django-15499
d90e34c61b27fba2527834806639eebbcfab9631
diff --git a/django/db/migrations/operations/models.py b/django/db/migrations/operations/models.py --- a/django/db/migrations/operations/models.py +++ b/django/db/migrations/operations/models.py @@ -170,6 +170,19 @@ def reduce(self, operation, app_label): managers=self.managers, ),...
diff --git a/tests/migrations/test_optimizer.py b/tests/migrations/test_optimizer.py --- a/tests/migrations/test_optimizer.py +++ b/tests/migrations/test_optimizer.py @@ -129,6 +129,30 @@ def test_create_alter_model_options(self): ], ) + def test_create_alter_model_managers(self): + se...
Optimize CreateModel + AlterModelManagers to CreateModel Description During migration optimization, CreateModel + AlterModelOptions is reduced to just CreateModel, with the model options. Similarly, CreateModel + AlterModelManagers can become just CreateModel.
2022-03-10T22:32:35Z
4.1
["test_create_alter_model_managers (migrations.test_optimizer.OptimizerTests)"]
["AlterField should optimize into AddField.", "RemoveField should cancel AddField", "RenameField should optimize into AddField", "test_alter_alter_index_model (migrations.test_optimizer.OptimizerTests)", "test_alter_alter_owrt_model (migrations.test_optimizer.OptimizerTests)", "test_alter_alter_table_model (migrations....
647480166bfe7532e8c471fef0146e3a17e6c0c9
<15 min fix
193
django/django
django__django-11603
f618e033acd37d59b536d6e6126e6c5be18037f6
diff --git a/django/db/models/aggregates.py b/django/db/models/aggregates.py --- a/django/db/models/aggregates.py +++ b/django/db/models/aggregates.py @@ -99,6 +99,7 @@ def _get_repr_options(self): class Avg(FixDurationInputMixin, NumericOutputFieldMixin, Aggregate): function = 'AVG' name = 'Avg' + allow_...
diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -388,9 +388,6 @@ def test_count(self): vals = Book.objects.aggregate(Count("rating")) self.assertEqual(vals, {"rating__count": 6}) - vals = Book.objects.ag...
Add DISTINCT support for Avg and Sum aggregates. Description As an extension of #28658, aggregates should be supported for other general aggregates such as Avg and Sum. Before 2.2, these aggregations just ignored the parameter, but now throw an exception. This change would just involve setting these classes as allowi...
​PR
2019-07-28T18:14:23Z
3.0
["test_distinct_on_aggregate (aggregation.tests.AggregateTestCase)", "test_empty_aggregate (aggregation.tests.AggregateTestCase)"]
["test_add_implementation (aggregation.tests.AggregateTestCase)", "test_aggregate_alias (aggregation.tests.AggregateTestCase)", "test_aggregate_annotation (aggregation.tests.AggregateTestCase)", "test_aggregate_in_order_by (aggregation.tests.AggregateTestCase)", "test_aggregate_multi_join (aggregation.tests.AggregateTe...
419a78300f7cd27611196e1e464d50fd0385ff27
<15 min fix
55
django/django
django__django-14311
5a8e8f80bb82a867eab7e4d9d099f21d0a976d22
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py --- a/django/utils/autoreload.py +++ b/django/utils/autoreload.py @@ -223,8 +223,13 @@ def get_child_arguments(): # __spec__ is set when the server was started with the `-m` option, # see https://docs.python.org/3/reference/import.html#main-...
diff --git a/tests/utils_tests/test_autoreload.py b/tests/utils_tests/test_autoreload.py --- a/tests/utils_tests/test_autoreload.py +++ b/tests/utils_tests/test_autoreload.py @@ -23,7 +23,7 @@ from django.utils import autoreload from django.utils.autoreload import WatchmanUnavailable -from .test_module import __mai...
Allow autoreloading of `python -m custom_module runserver` Description (last modified by Mariusz Felisiak) The original fix [1] only attempted to deal with -m foo.bar where bar is a package and __main__.py exists under foo/bar. When a dotted name for a module (for example, foo.bar.baz where baz.py resides under...
Patch It doesn't work in Django 3.1 so I would not call it a regression. Can you send PR via GitHub? Looks fine. The one change I'd make is that I'd change modspec.name.split(".")[-1] == "__main__" to modspec.name == "__main__" or modspec.name.endswith(".__main__") to avoid dumb corner cases like a module named foo.my_...
2021-04-25T02:54:34Z
4.0
["test_run_as_non_django_module_non_package (utils_tests.test_autoreload.TestChildArguments)"]
["test_is_django_module (utils_tests.test_autoreload.TestUtilities)", "test_is_django_path (utils_tests.test_autoreload.TestUtilities)", "test_common_roots (utils_tests.test_autoreload.TestCommonRoots)", "test_no_exception (utils_tests.test_autoreload.TestRaiseLastException)", "test_raises_custom_exception (utils_tests...
475cffd1d64c690cdad16ede4d5e81985738ceb4
15 min - 1 hour
148
astropy/astropy
astropy__astropy-7606
3cedd79e6c121910220f8e6df77c54a0b344ea94
diff --git a/astropy/units/core.py b/astropy/units/core.py --- a/astropy/units/core.py +++ b/astropy/units/core.py @@ -728,7 +728,7 @@ def __eq__(self, other): try: other = Unit(other, parse_strict='silent') except (ValueError, UnitsError, TypeError): - return False + ...
diff --git a/astropy/units/tests/test_units.py b/astropy/units/tests/test_units.py --- a/astropy/units/tests/test_units.py +++ b/astropy/units/tests/test_units.py @@ -185,6 +185,13 @@ def test_unknown_unit3(): assert unit != unit3 assert not unit.is_equivalent(unit3) + # Also test basic (in)equalities. +...
Unit equality comparison with None raises TypeError for UnrecognizedUnit ``` In [12]: x = u.Unit('asdf', parse_strict='silent') In [13]: x == None # Should be False --------------------------------------------------------------------------- TypeError Traceback (most recent call la...
`x is None` works fine. Is there a reason why `==` is needed here? `x is None` would indeed be preferred, but `==` should never fail, so this is still a bug.
2018-06-29T16:27:46Z
1.3
["astropy/units/tests/test_units.py::test_unknown_unit3"]
["astropy/units/tests/test_units.py::test_getting_started", "astropy/units/tests/test_units.py::test_initialisation", "astropy/units/tests/test_units.py::test_invalid_power", "astropy/units/tests/test_units.py::test_invalid_compare", "astropy/units/tests/test_units.py::test_convert", "astropy/units/tests/test_units.py:...
848c8fa21332abd66b44efe3cb48b72377fb32cc
15 min - 1 hour
18
django/django
django__django-15732
ce69e34bd646558bb44ea92cecfd98b345a0b3e0
diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -528,7 +528,10 @@ def alter_unique_together(self, model, old_unique_together, new_unique_together) # Deleted uniques for fields in olds....
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -2809,6 +2809,69 @@ def test_alter_unique_together_remove(self): operation.describe(), "Alter unique_together for Pony (0 constraint(...
Cannot drop unique_together constraint on a single field with its own unique=True constraint Description I have an erroneous unique_together constraint on a model's primary key (unique_together = (('id',),)) that cannot be dropped by a migration. Apparently the migration tries to find all unique constraints on the co...
Can you share a traceback that shows how and where the migration fails, please. Here it is: Traceback (most recent call last): File "./bin/django", line 56, in <module> sys.exit(djangorecipe.manage.main('project.settings.local.foobar')) File "/foo/bar/eggs/djangorecipe-1.10-py2.7.egg/djangorecipe/manage.py", line 9, in...
2022-05-24T12:58:31Z
4.2
["test_remove_unique_together_on_unique_field (migrations.test_operations.OperationTests)"]
["test_reference_field_by_through_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_from_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_name (migrations.test_operations.FieldOperationTests)", "test_references_field_by_remote_field_model (migrations....
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
15 min - 1 hour
204
django/django
django__django-12276
53d8646f799de7f92ab9defe9dc56c6125448102
diff --git a/django/forms/widgets.py b/django/forms/widgets.py --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -387,6 +387,9 @@ def value_from_datadict(self, data, files, name): def value_omitted_from_data(self, data, files, name): return name not in files + def use_required_attribute(...
diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -8,11 +8,11 @@ from django.core.validators import MaxValueValidator, RegexValidator from django.forms import ( BooleanField, CharFi...
FileInput shouldn't display required attribute when initial data exists. Description (last modified by thenewguy) I think that ClearableFileInput.use_required_attribute() (​https://github.com/django/django/blob/e703b93a656b78b9b444bb3a9980e305ed002a70/django/forms/widgets.py#L454) should be moved to FileInput.u...
This might explain better: from django import forms from django.core.files.base import ContentFile from django.test import SimpleTestCase class FileForm(forms.Form): file = forms.FileField(widget=forms.FileInput) class FileInputRenderTest(SimpleTestCase): def test_file_input(self): form = FileForm() field = form['file'...
2020-01-05T08:04:40Z
3.1
["test_use_required_attribute (forms_tests.widget_tests.test_fileinput.FileInputTest)", "test_filefield_with_fileinput_required (forms_tests.tests.test_forms.FormsTestCase)"]
["test_attribute_class (forms_tests.tests.test_forms.RendererTests)", "test_attribute_instance (forms_tests.tests.test_forms.RendererTests)", "test_attribute_override (forms_tests.tests.test_forms.RendererTests)", "test_default (forms_tests.tests.test_forms.RendererTests)", "test_kwarg_class (forms_tests.tests.test_for...
0668164b4ac93a5be79f5b87fae83c657124d9ab
<15 min fix
78
sympy/sympy
sympy__sympy-24066
514579c655bf22e2af14f0743376ae1d7befe345
diff --git a/sympy/physics/units/unitsystem.py b/sympy/physics/units/unitsystem.py --- a/sympy/physics/units/unitsystem.py +++ b/sympy/physics/units/unitsystem.py @@ -190,10 +190,9 @@ def _collect_factor_and_dimension(self, expr): dim /= idim**count return factor, dim elif isinsta...
diff --git a/sympy/physics/units/tests/test_quantities.py b/sympy/physics/units/tests/test_quantities.py --- a/sympy/physics/units/tests/test_quantities.py +++ b/sympy/physics/units/tests/test_quantities.py @@ -541,6 +541,27 @@ def test_issue_20288(): assert SI._collect_factor_and_dimension(expr) == (1 + E, Dimens...
SI._collect_factor_and_dimension() cannot properly detect that exponent is dimensionless How to reproduce: ```python from sympy import exp from sympy.physics import units from sympy.physics.units.systems.si import SI expr = units.second / (units.ohm * units.farad) dim = SI._collect_factor_and_dimension(expr)[...
2022-09-16T22:58:15Z
1.12
["test_issue_24062"]
["test_str_repr", "test_eq", "test_convert_to", "test_Quantity_definition", "test_abbrev", "test_print", "test_Quantity_eq", "test_add_sub", "test_quantity_abs", "test_check_unit_consistency", "test_mul_div", "test_units", "test_issue_quart", "test_issue_5565", "test_find_unit", "test_Quantity_derivative", "test_quanti...
c6cb7c5602fa48034ab1bd43c2347a7e8488f12e
15 min - 1 hour
494
matplotlib/matplotlib
matplotlib__matplotlib-22871
a7b7260bf06c20d408215d95ce20a1a01c12e5b1
diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -796,8 +796,10 @@ def format_ticks(self, values): # mostly 0: years, 1: months, 2: days, # 3: hours, 4: minutes, 5: seconds, 6: microseconds for level in range(5, -1...
diff --git a/lib/matplotlib/tests/test_dates.py b/lib/matplotlib/tests/test_dates.py --- a/lib/matplotlib/tests/test_dates.py +++ b/lib/matplotlib/tests/test_dates.py @@ -630,6 +630,10 @@ def test_offset_changes(): ax.set_xlim(d1, d1 + datetime.timedelta(weeks=3)) fig.draw_without_rendering() assert form...
[Bug]: ConciseDateFormatter not showing year anywhere when plotting <12 months ### Bug summary When I plot < 1 year and January is not included in the x-axis, the year doesn't show up anywhere. This bug is different from bug #21670 (fixed in #21785). ### Code for reproduction ```python import matplotlib.pyplot as p...
@anntzer working on this
2022-04-21T13:10:50Z
3.5
["lib/matplotlib/tests/test_dates.py::test_offset_changes"]
["lib/matplotlib/tests/test_dates.py::test_date_numpyx", "lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[s]-t00]", "lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[s]-t01]", "lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[s]-t02]", "lib/matplotli...
de98877e3dc45de8dd441d008f23d88738dc015d
15 min - 1 hour
262
pylint-dev/pylint
pylint-dev__pylint-4970
40cc2ffd7887959157aaf469e09585ec2be7f528
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -390,6 +390,8 @@ def append_stream(self, streamid: str, stream: TextIO, encoding=None) -> None: def run(self) -> None: """start looking for similarities and display r...
diff --git a/tests/checkers/unittest_similar.py b/tests/checkers/unittest_similar.py --- a/tests/checkers/unittest_similar.py +++ b/tests/checkers/unittest_similar.py @@ -502,3 +502,11 @@ def test_get_map_data() -> None: # There doesn't seem to be a faster way of doing this, yet. lines = (linespec.tex...
Setting `min-similarity-lines` to `0` should stop pylint from checking duplicate code ### Current problem Setting `min-similarity-lines` to `0` in the rcfile doesn't disable checking for duplicate code, it instead treats every line of code as duplicate and raises many errors. ### Desired solution Setting `min-simila...
It's a nice enhancement, thank you for opening the issue. The way to disable duplicate code is by using: ```ini [MASTER] disable=duplicate-code ``` As you saw in issue 214, it's currently impossible to disable duplicate-code **in some part of the code and not the other** but this is another issue entirely.
2021-09-05T19:44:07Z
2.10
["tests/checkers/unittest_similar.py::test_set_duplicate_lines_to_zero"]
["tests/checkers/unittest_similar.py::test_ignore_comments", "tests/checkers/unittest_similar.py::test_ignore_docstrings", "tests/checkers/unittest_similar.py::test_ignore_imports", "tests/checkers/unittest_similar.py::test_multiline_imports", "tests/checkers/unittest_similar.py::test_ignore_multiline_imports", "tests/...
bc95cd34071ec2e71de5bca8ff95cc9b88e23814
<15 min fix
323
sympy/sympy
sympy__sympy-21847
d9b18c518d64d0ebe8e35a98c2fb519938b9b151
diff --git a/sympy/polys/monomials.py b/sympy/polys/monomials.py --- a/sympy/polys/monomials.py +++ b/sympy/polys/monomials.py @@ -127,7 +127,7 @@ def itermonomials(variables, max_degrees, min_degrees=None): for variable in item: if variable != 1: powers[va...
diff --git a/sympy/polys/tests/test_monomials.py b/sympy/polys/tests/test_monomials.py --- a/sympy/polys/tests/test_monomials.py +++ b/sympy/polys/tests/test_monomials.py @@ -15,7 +15,6 @@ from sympy.core import S, symbols from sympy.testing.pytest import raises - def test_monomials(): # total_degree tests ...
itermonomials returns incorrect monomials when using min_degrees argument `itermonomials` returns incorrect monomials when using optional `min_degrees` argument For example, the following code introduces three symbolic variables and generates monomials with max and min degree of 3: ``` import sympy as sp from...
Doesn't look like the `min_degrees` argument is actually used anywhere in the codebase. Also there don't seem to be any nontrivial tests for passing `min_degrees` as an integer. The issue would be fixed with this diff and some tests in `test_monomials.py`: ```diff diff --git a/sympy/polys/monomials.py b/sympy/poly...
2021-08-10T17:41:59Z
1.9
["test_monomials"]
["test_monomial_count", "test_monomial_mul", "test_monomial_div", "test_monomial_gcd", "test_monomial_lcm", "test_monomial_max", "test_monomial_pow", "test_monomial_min", "test_monomial_divides"]
f9a6f50ec0c74d935c50a6e9c9b2cb0469570d91
<15 min fix
483
django/django
django__django-12304
4c1b401e8250f9f520b3c7dc369554477ce8b15a
diff --git a/django/db/models/enums.py b/django/db/models/enums.py --- a/django/db/models/enums.py +++ b/django/db/models/enums.py @@ -31,6 +31,7 @@ def __new__(metacls, classname, bases, classdict): # that is passed in as "self" as the value to use when looking up the # label in the choices. ...
diff --git a/tests/model_enums/tests.py b/tests/model_enums/tests.py --- a/tests/model_enums/tests.py +++ b/tests/model_enums/tests.py @@ -4,6 +4,7 @@ import uuid from django.db import models +from django.template import Context, Template from django.test import SimpleTestCase from django.utils.functional import ...
Enumeration Types are not usable in templates. Description (last modified by Mariusz Felisiak) The new ​enumeration types are great but can't be used in Django templates due to their being callable. For example this doesn't work: {% if student.year_in_school == YearInSchool.FRESHMAN %} This is because YearInSch...
2020-01-09T15:43:51Z
3.1
["test_templates (model_enums.tests.ChoicesTests)"]
["test_integerchoices (model_enums.tests.ChoicesTests)", "test_integerchoices_auto_label (model_enums.tests.ChoicesTests)", "test_integerchoices_containment (model_enums.tests.ChoicesTests)", "test_integerchoices_empty_label (model_enums.tests.ChoicesTests)", "test_integerchoices_functional_api (model_enums.tests.Choic...
0668164b4ac93a5be79f5b87fae83c657124d9ab
<15 min fix
79
django/django
django__django-11206
571ab44e8a8936014c22e7eebe4948d9611fd7ce
diff --git a/django/utils/numberformat.py b/django/utils/numberformat.py --- a/django/utils/numberformat.py +++ b/django/utils/numberformat.py @@ -27,6 +27,14 @@ def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', # sign sign = '' if isinstance(number, Decimal): + + if d...
diff --git a/tests/utils_tests/test_numberformat.py b/tests/utils_tests/test_numberformat.py --- a/tests/utils_tests/test_numberformat.py +++ b/tests/utils_tests/test_numberformat.py @@ -94,7 +94,7 @@ def test_decimal_numbers(self): ('1e-10', 8, '0.00000000'), ('1e-11', 8, '0.00000000'), ...
utils.numberformat.format renders small decimals in exponential notation. Description When using utils.number_format with decimal_pos, extremely small numbers get displayed using exponential notation. >>> from django.utils.numberformat import format as nformat >>> nformat(Decimal('1e-199'), '.', decimal_pos=2) '0.00'...
Hi Sjoerd. OK, so this is related to the changes in 9cc6a60040b0f64f8ea066dd215176d4bd16621d. Happy to Accept as a potential Cleanup/optimization — I guess ultimately it depends on what the change looks like. (i.e. is the nicer behaviour worth the extra complexity? etc) I'm assuming you're ready/willing to make the pat...
2019-04-13T10:19:38Z
3.0
["test_decimal_numbers (utils_tests.test_numberformat.TestNumberFormat)", "test_decimal_subclass (utils_tests.test_numberformat.TestNumberFormat)"]
["test_float_numbers (utils_tests.test_numberformat.TestNumberFormat)", "test_format_number (utils_tests.test_numberformat.TestNumberFormat)", "test_format_string (utils_tests.test_numberformat.TestNumberFormat)", "test_large_number (utils_tests.test_numberformat.TestNumberFormat)"]
419a78300f7cd27611196e1e464d50fd0385ff27
15 min - 1 hour
39
sympy/sympy
sympy__sympy-15809
28d913d3cead6c5646307ffa6540b21d65059dfd
diff --git a/sympy/functions/elementary/miscellaneous.py b/sympy/functions/elementary/miscellaneous.py --- a/sympy/functions/elementary/miscellaneous.py +++ b/sympy/functions/elementary/miscellaneous.py @@ -339,8 +339,6 @@ def real_root(arg, n=None, evaluate=None): class MinMaxBase(Expr, LatticeOp): def __new__...
diff --git a/sympy/functions/elementary/tests/test_miscellaneous.py b/sympy/functions/elementary/tests/test_miscellaneous.py --- a/sympy/functions/elementary/tests/test_miscellaneous.py +++ b/sympy/functions/elementary/tests/test_miscellaneous.py @@ -86,7 +86,8 @@ def test_Min(): assert Min(p, p_).func is Min ...
Zero-argument Min() and Max() Right now `Min()` and `Max()` with no arguments raise `ValueError: The Max/Min functions must have arguments.`. It might be mathematically more convenient to have them return `oo` and `-oo`, respectively. See https://en.wikipedia.org/wiki/Empty_set#Extended_real_numbers for why these are v...
Okk I will fix this issue.
2019-01-20T06:08:26Z
1.4
["test_Min", "test_Max"]
["test_minmax_assumptions", "test_issue_8413", "test_root", "test_real_root", "test_rewrite_MaxMin_as_Heaviside", "test_rewrite_MaxMin_as_Piecewise", "test_issue_11099", "test_issue_12638", "test_instantiation_evaluation", "test_rewrite_as_Abs"]
73b3f90093754c5ed1561bd885242330e3583004
<15 min fix
451
django/django
django__django-11333
55b68de643b5c2d5f0a8ea7587ab3b2966021ccc
diff --git a/django/urls/base.py b/django/urls/base.py --- a/django/urls/base.py +++ b/django/urls/base.py @@ -7,7 +7,7 @@ from django.utils.translation import override from .exceptions import NoReverseMatch, Resolver404 -from .resolvers import get_ns_resolver, get_resolver +from .resolvers import _get_cached_resol...
diff --git a/tests/urlpatterns/test_resolvers.py b/tests/urlpatterns/test_resolvers.py --- a/tests/urlpatterns/test_resolvers.py +++ b/tests/urlpatterns/test_resolvers.py @@ -1,5 +1,6 @@ from django.test import SimpleTestCase -from django.urls.resolvers import RegexPattern, RoutePattern +from django.test.utils import ...
Optimization: Multiple URLResolvers may be unintentionally be constructed by calls to `django.urls.resolvers.get_resolver` Description Multiple URLResolvers may be constructed by django.urls.resolvers.get_resolver if django.urls.base.set_urlconf has not yet been called, resulting in multiple expensive calls to URLRes...
I'm planning to contribute a fix, as soon as I can get the CLA signed. Hi. Great. Happy to provisionally Accept this pending how the patch looks. (Sounds fine in principle.) Welcome on-board! :)
2019-05-06T21:00:53Z
3.0
["test_resolver_cache_default__root_urlconf (urlpatterns.test_resolvers.ResolverCacheTests)"]
["test_str (urlpatterns.test_resolvers.RegexPatternTests)", "test_str (urlpatterns.test_resolvers.RoutePatternTests)"]
419a78300f7cd27611196e1e464d50fd0385ff27
15 min - 1 hour
46
django/django
django__django-16661
d687febce5868545f99974d2499a91f81a32fef5
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -461,12 +461,14 @@ def lookup_allowed(self, lookup, value): # Lookups on nonexistent fields are ok, since they're ignored # late...
diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py --- a/tests/modeladmin/tests.py +++ b/tests/modeladmin/tests.py @@ -154,6 +154,35 @@ class EmployeeProfileAdmin(ModelAdmin): ma.lookup_allowed("employee__department__code", "test_value"), True ) + @isolate_apps("modeladmin") +...
ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key Description (last modified by Tim Graham) Wrote a failing test for tests/modeladmin/tests.py to demonstrate - same test/code passes on 1.8 @isolate_apps('modeladmin') def test_lookup_allowed_foreign_...
Bisected to 8f30556329b64005d63b66859a74752a0b261315.
2023-03-18T09:26:58Z
5.0
["test_lookup_allowed_foreign_primary (modeladmin.tests.ModelAdminTests.test_lookup_allowed_foreign_primary)"]
["has_add_permission returns True for users who can add objects and", "has_change_permission returns True for users who can edit objects and", "has_delete_permission returns True for users who can delete objects and", "as_module_permission returns True for users who have any permission", "has_view_permission() returns ...
4a72da71001f154ea60906a2f74898d32b7322a7
15 min - 1 hour
238
sphinx-doc/sphinx
sphinx-doc__sphinx-7462
b3e26a6c851133b82b50f4b68b53692076574d13
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -105,11 +105,16 @@ def unparse(node: ast.AST) -> List[Node]: result.append(addnodes.desc_sig_punctuation('', ']')) return result elif isinstance(node, ast....
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -255,6 +255,13 @@ def test_parse_annotation(): [pending_xref, "int"], [desc_sig_punctuation, "]"])) + doctree = _parse_annotation("Tupl...
`IndexError: pop from empty list` for empty tuple type annotation **Describe the bug** Following notation for empty tuple from [this mypy issue](https://github.com/python/mypy/issues/4211) like ```python from typing import Tuple def foo() -> Tuple[()]: """Sample text.""" return () ``` I get ```bash F...
Changing https://github.com/sphinx-doc/sphinx/blob/b3e26a6c851133b82b50f4b68b53692076574d13/sphinx/domains/python.py#L117-L122 to ```python if node.elts: result = [] for elem in node.elts: result.extend(unparse(elem)) result.app...
2020-04-12T04:10:05Z
3.1
["tests/test_domain_py.py::test_parse_annotation", "tests/test_pycode_ast.py::test_unparse[()-()]"]
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_find_obj", "tests/test_domain_py.py::test_get_full_qualified_nam...
5afc77ee27fc01c57165ab260d3a76751f9ddb35
<15 min fix
391
scikit-learn/scikit-learn
scikit-learn__scikit-learn-11310
553b5fb8f84ba05c8397f26dd079deece2b05029
diff --git a/sklearn/model_selection/_search.py b/sklearn/model_selection/_search.py --- a/sklearn/model_selection/_search.py +++ b/sklearn/model_selection/_search.py @@ -17,6 +17,7 @@ from functools import partial, reduce from itertools import product import operator +import time import warnings import numpy as...
diff --git a/sklearn/model_selection/tests/test_search.py b/sklearn/model_selection/tests/test_search.py --- a/sklearn/model_selection/tests/test_search.py +++ b/sklearn/model_selection/tests/test_search.py @@ -26,6 +26,7 @@ from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert...
Retrieving time to refit the estimator in BaseSearchCV Basically, I'm trying to figure out how much time it takes to refit the best model on the full data after doing grid/random search. What I can so far do is retrieve the time it takes to fit and score each model: ``` import sklearn.datasets import sklearn.model_s...
I'm fine with storing this.
2018-06-18T12:10:19Z
0.20
["sklearn/model_selection/tests/test_search.py::test_search_cv_timing"]
["sklearn/model_selection/tests/test_search.py::test_parameter_grid", "sklearn/model_selection/tests/test_search.py::test_grid_search", "sklearn/model_selection/tests/test_search.py::test_grid_search_with_fit_params", "sklearn/model_selection/tests/test_search.py::test_random_search_with_fit_params", "sklearn/model_sel...
55bf5d93e5674f13a1134d93a11fd0cd11aabcd1
<15 min fix
352
pytest-dev/pytest
pytest-dev__pytest-7236
c98bc4cd3d687fe9b392d8eecd905627191d4f06
diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -41,7 +41,7 @@ def collect(self): if not getattr(cls, "__test__", True): return - skipped = getattr(cls, "__unittest_skip__", False) + skipped = _is_skipped...
diff --git a/testing/test_unittest.py b/testing/test_unittest.py --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -1193,6 +1193,40 @@ def test_2(self): ] +@pytest.mark.parametrize("mark", ["@unittest.skip", "@pytest.mark.skip"]) +def test_pdb_teardown_skipped(testdir, monkeypatch, mark): + "...
unittest.TestCase.tearDown executed on skipped tests when running --pdb With this minimal test: ```python import unittest class MyTestCase(unittest.TestCase): def setUp(self): xxx @unittest.skip("hello") def test_one(self): pass def tearDown(self): xxx ``` ``` ...
This might a regression from https://github.com/pytest-dev/pytest/pull/7151 , I see it changes pdb, skip and teardown I'd like to work on this. Hi @gdhameeja, Thanks for the offer, but this is a bit trickier because of the unittest-pytest interaction. I plan to tackle this today as it is a regression. 👍 But aga...
2020-05-21T19:53:14Z
5.4
["testing/test_unittest.py::test_pdb_teardown_skipped[@unittest.skip]"]
["testing/test_unittest.py::test_simple_unittest", "testing/test_unittest.py::test_runTest_method", "testing/test_unittest.py::test_isclasscheck_issue53", "testing/test_unittest.py::test_setup", "testing/test_unittest.py::test_setUpModule", "testing/test_unittest.py::test_setUpModule_failing_no_teardown", "testing/test...
678c1a0745f1cf175c442c719906a1f13e496910
15 min - 1 hour
341
matplotlib/matplotlib
matplotlib__matplotlib-25311
430fb1db88843300fb4baae3edc499bbfe073b0c
diff --git a/lib/matplotlib/offsetbox.py b/lib/matplotlib/offsetbox.py --- a/lib/matplotlib/offsetbox.py +++ b/lib/matplotlib/offsetbox.py @@ -1505,7 +1505,6 @@ def __init__(self, ref_artist, use_blit=False): if not ref_artist.pickable(): ref_artist.set_picker(True) self.got_artist = Fals...
diff --git a/lib/matplotlib/tests/test_pickle.py b/lib/matplotlib/tests/test_pickle.py --- a/lib/matplotlib/tests/test_pickle.py +++ b/lib/matplotlib/tests/test_pickle.py @@ -1,6 +1,7 @@ from io import BytesIO import ast import pickle +import pickletools import numpy as np import pytest @@ -88,6 +89,7 @@ def _ge...
[Bug]: Unable to pickle figure with draggable legend ### Bug summary I am unable to pickle figure with draggable legend. Same error comes for draggable annotations. ### Code for reproduction ```python import matplotlib.pyplot as plt import pickle fig = plt.figure() ax = fig.add_subplot(111) ti...
2023-02-23T21:04:12Z
3.7
["lib/matplotlib/tests/test_pickle.py::test_complete[png]"]
["lib/matplotlib/tests/test_pickle.py::test_simple", "lib/matplotlib/tests/test_pickle.py::test_gcf", "lib/matplotlib/tests/test_pickle.py::test_no_pyplot", "lib/matplotlib/tests/test_pickle.py::test_renderer", "lib/matplotlib/tests/test_pickle.py::test_image", "lib/matplotlib/tests/test_pickle.py::test_polar", "lib/ma...
0849036fd992a2dd133a0cffc3f84f58ccf1840f
<15 min fix
277
psf/requests
psf__requests-1142
22623bd8c265b78b161542663ee980738441c307
diff --git a/requests/models.py b/requests/models.py --- a/requests/models.py +++ b/requests/models.py @@ -386,13 +386,14 @@ def prepare_body(self, data, files): self.body = body def prepare_content_length(self, body): - self.headers['Content-Length'] = '0' if hasattr(body, 'seek') and h...
diff --git a/test_requests.py b/test_requests.py --- a/test_requests.py +++ b/test_requests.py @@ -58,6 +58,13 @@ def test_basic_building(self): assert pr.body == 'life=42' + def test_no_content_length(self): + get_req = requests.Request('GET', httpbin('get')).prepare() + self.assertTrue('...
requests.get is ALWAYS sending content length Hi, It seems like that request.get always adds 'content-length' header to the request. I think that the right behavior is not to add this header automatically in GET requests or add the possibility to not send it. For example http://amazon.com returns 503 for every get re...
This was done in issue #957 - Attach Content-Length to everything. OK, I don't think it's the right solution. imho GET requests shouldn't contain by default 'content-length' header. Related: geemus/excon/pull/113 There's nothing stopping you from sending data in a GET request. At the moment the following code: requ...
2013-01-25T05:19:16Z
1.1
["test_requests.py::RequestsTestCase::test_no_content_length"]
["test_requests.py::RequestsTestCase::test_basic_building", "test_requests.py::RequestsTestCase::test_entry_points", "test_requests.py::RequestsTestCase::test_invalid_url", "test_requests.py::RequestsTestCase::test_params_are_added_before_fragment", "test_requests.py::RequestsTestCase::test_path_is_not_double_encoded"]
ba25184ed5f0bf9b876dea3cf4312fa35b539a7c
<15 min fix
290
pydata/xarray
pydata__xarray-7229
3aa75c8d00a4a2d4acf10d80f76b937cadb666b7
diff --git a/xarray/core/computation.py b/xarray/core/computation.py --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -1855,15 +1855,13 @@ def where(cond, x, y, keep_attrs=None): Dataset.where, DataArray.where : equivalent methods """ + from .dataset import Dataset + if ke...
diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py --- a/xarray/tests/test_computation.py +++ b/xarray/tests/test_computation.py @@ -1925,16 +1925,63 @@ def test_where() -> None: def test_where_attrs() -> None: - cond = xr.DataArray([True, False], dims="x", attrs={"attr": "cond"}) ...
`xr.where(..., keep_attrs=True)` overwrites coordinate attributes ### What happened? #6461 had some unintended consequences for `xr.where(..., keep_attrs=True)`, where coordinate attributes are getting overwritten by variable attributes. I guess this has been broken since `2022.06.0`. ### What did you expect to happe...
Original looks like this: ```python # keep the attributes of x, the second parameter, by default to # be consistent with the `where` method of `DataArray` and `Dataset` keep_attrs = lambda attrs, context: attrs[1] ``` New one looks like this: ```python # keep the attributes of x, the second parameter, by defa...
2022-10-26T21:45:01Z
2022.09
["xarray/tests/test_computation.py::test_where_attrs"]
["xarray/tests/test_computation.py::test_signature_properties", "xarray/tests/test_computation.py::test_result_name", "xarray/tests/test_computation.py::test_ordered_set_union", "xarray/tests/test_computation.py::test_ordered_set_intersection", "xarray/tests/test_computation.py::test_join_dict_keys", "xarray/tests/test...
087ebbb78668bdf5d2d41c3b2553e3f29ce75be1
15 min - 1 hour
317
pydata/xarray
pydata__xarray-4075
19b088636eb7d3f65ab7a1046ac672e0689371d8
diff --git a/xarray/core/weighted.py b/xarray/core/weighted.py --- a/xarray/core/weighted.py +++ b/xarray/core/weighted.py @@ -142,7 +142,14 @@ def _sum_of_weights( # we need to mask data values that are nan; else the weights are wrong mask = da.notnull() - sum_of_weights = self._reduce(mask,...
diff --git a/xarray/tests/test_weighted.py b/xarray/tests/test_weighted.py --- a/xarray/tests/test_weighted.py +++ b/xarray/tests/test_weighted.py @@ -59,6 +59,18 @@ def test_weighted_sum_of_weights_nan(weights, expected): assert_equal(expected, result) +def test_weighted_sum_of_weights_bool(): + # https://...
[bug] when passing boolean weights to weighted mean <!-- A short summary of the issue, if appropriate --> #### MCVE Code Sample <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): http://matthewrocklin.com/blog/wor...
2020-05-18T18:42:05Z
0.12
["xarray/tests/test_weighted.py::test_weighted_sum_of_weights_bool", "xarray/tests/test_weighted.py::test_weighted_mean_bool"]
["xarray/tests/test_weighted.py::test_weighted_non_DataArray_weights[True]", "xarray/tests/test_weighted.py::test_weighted_non_DataArray_weights[False]", "xarray/tests/test_weighted.py::test_weighted_weights_nan_raises[weights0-True]", "xarray/tests/test_weighted.py::test_weighted_weights_nan_raises[weights0-False]", "...
1c198a191127c601d091213c4b3292a8bb3054e1
<15 min fix
304
matplotlib/matplotlib
matplotlib__matplotlib-24149
af39f1edffcd828f05cfdd04f2e59506bb4a27bc
diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2182,11 +2182,19 @@ def _convert_dx(dx, x0, xconv, convert): x0 = cbook._safe_first_finite(x0) except (TypeError, IndexError, KeyError): ...
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -8195,3 +8195,16 @@ def test_bar_leading_nan(): for b in rest: assert np.isfinite(b.xy).all() assert np.isfinite(b.get_...
[Bug]: ax.bar raises for all-nan data on matplotlib 3.6.1 ### Bug summary `ax.bar` raises an exception in 3.6.1 when passed only nan data. This irrevocably breaks seaborn's histogram function (which draws and then removes a "phantom" bar to trip the color cycle). ### Code for reproduction ```python import numpy as ...
This is the PR in question: https://github.com/matplotlib/matplotlib/pull/23751 (although I have not checked is that is causing it). Thanks @oscargus that indeed looks like the culprit: it asks for the "next" finite value and does not handle the `StopIteration` exception that you get if there isn't one. > which draws a...
2022-10-12T22:00:54Z
3.6
["lib/matplotlib/tests/test_axes.py::test_bar_all_nan[png]"]
["lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/test...
73909bcb408886a22e2b84581d6b9e6d9907c813
<15 min fix
268
django/django
django__django-12039
58c1acb1d6054dfec29d0f30b1033bae6ef62aec
diff --git a/django/db/backends/ddl_references.py b/django/db/backends/ddl_references.py --- a/django/db/backends/ddl_references.py +++ b/django/db/backends/ddl_references.py @@ -83,10 +83,14 @@ def __init__(self, table, columns, quote_name, col_suffixes=()): def __str__(self): def col_str(column, idx):...
diff --git a/tests/indexes/tests.py b/tests/indexes/tests.py --- a/tests/indexes/tests.py +++ b/tests/indexes/tests.py @@ -75,6 +75,22 @@ def test_index_together_single_list(self): index_sql = connection.schema_editor()._model_indexes_sql(IndexTogetherSingleList) self.assertEqual(len(index_sql), 1) ...
Use proper whitespace in CREATE INDEX statements Description (last modified by Hannes Ljungberg) Creating an index through: index = Index( fields=['-name’], name='idx' ) Will generate the valid but not so pretty CREATE INDEX statement: CREATE INDEX "idx" ON "schema_author" ("name"DESC) The following would be...
PR: ​https://github.com/django/django/pull/12039 OK, I'll Accept this as a clean up (there's not actually an error right?). The patch looks small/clean enough at first glance. Correct, no error. But since it's not documented as valid syntax to not have whitespace between the column and the ordering it could break in fu...
2019-11-06T21:14:34Z
3.1
["test_descending_columns_list_sql (indexes.tests.SchemaIndexesTests)"]
["test_columns_list_sql (indexes.tests.SchemaIndexesTests)", "test_index_name (indexes.tests.SchemaIndexesTests)", "test_index_name_hash (indexes.tests.SchemaIndexesTests)", "test_index_together (indexes.tests.SchemaIndexesTests)", "test_index_together_single_list (indexes.tests.SchemaIndexesTests)", "test_create_index...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
69
sympy/sympy
sympy__sympy-16597
6fd65310fa3167b9626c38a5487e171ca407d988
diff --git a/sympy/assumptions/ask.py b/sympy/assumptions/ask.py --- a/sympy/assumptions/ask.py +++ b/sympy/assumptions/ask.py @@ -1484,13 +1484,16 @@ def get_known_facts(): Equivalent(Q.prime, Q.integer & Q.positive & ~Q.composite), Implies(Q.integer, Q.rational), Implies(Q.rational, Q.algeb...
diff --git a/sympy/core/tests/test_assumptions.py b/sympy/core/tests/test_assumptions.py --- a/sympy/core/tests/test_assumptions.py +++ b/sympy/core/tests/test_assumptions.py @@ -98,26 +98,26 @@ def test_infinity(): oo = S.Infinity assert oo.is_commutative is True - assert oo.is_integer is None - asse...
a.is_even does not imply a.is_finite I'm not sure what the right answer is here: ```julia In [1]: m = Symbol('m', even=True) In [2]: m.is_finite ...
Has anyone tried to represent SymPy's assumptions as a directed graph? Even just trying to draw it on paper might be a good idea for testing even if that isn't how the actual code handles it. I would very much like to see an explanation defining the meanings of the different `is_*` attributes somewhere. The implied rel...
2019-04-08T12:49:10Z
1.5
["test_infinity", "test_neg_infinity", "test_other_symbol"]
["test_symbol_unset", "test_zero", "test_one", "test_negativeone", "test_zoo", "test_nan", "test_pos_rational", "test_neg_rational", "test_pi", "test_E", "test_I", "test_symbol_real", "test_symbol_imaginary", "test_symbol_zero", "test_symbol_positive", "test_neg_symbol_positive", "test_symbol_nonpositive", "test_neg_sy...
70381f282f2d9d039da860e391fe51649df2779d
1-4 hours
455
sympy/sympy
sympy__sympy-18211
b4f1aa3540fe68d078d76e78ba59d022dd6df39f
diff --git a/sympy/core/relational.py b/sympy/core/relational.py --- a/sympy/core/relational.py +++ b/sympy/core/relational.py @@ -389,10 +389,17 @@ def __nonzero__(self): def _eval_as_set(self): # self is univariate and periodicity(self, x) in (0, None) from sympy.solvers.inequalities import sol...
diff --git a/sympy/core/tests/test_relational.py b/sympy/core/tests/test_relational.py --- a/sympy/core/tests/test_relational.py +++ b/sympy/core/tests/test_relational.py @@ -1,7 +1,7 @@ from sympy.utilities.pytest import XFAIL, raises, warns_deprecated_sympy from sympy import (S, Symbol, symbols, nan, oo, I, pi, Flo...
`solveset` raises `NotImplementedError` instead of returning `ConditionSet` The problem is ```julia In [10]: Eq(n*cos(n) - 3*sin(n), 0).as_set() ----------------------------------------------------------...
this is currently blocking #17771 I think that this can fix it: ```diff diff --git a/sympy/core/relational.py b/sympy/core/relational.py index f4ede7de61..5232a277c8 100644 --- a/sympy/core/relational.py +++ b/sympy/core/relational.py @@ -379,11 +379,18 @@ def __nonzero__(self): def _eval_as_set(self): ...
2020-01-03T06:39:19Z
1.6
["test_issue_18188"]
["test_rel_ne", "test_rel_subs", "test_wrappers", "test_Eq", "test_as_poly", "test_rel_Infinity", "test_infinite_symbol_inequalities", "test_bool", "test_rich_cmp", "test_doit", "test_new_relational", "test_relational_arithmetic", "test_relational_bool_output", "test_relational_logic_symbols", "test_univariate_relation...
28b41c73c12b70d6ad9f6e45109a80649c4456da
15 min - 1 hour
465
django/django
django__django-14404
de32fe83a2e4a20887972c69a0693b94eb25a88b
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py --- a/django/contrib/admin/sites.py +++ b/django/contrib/admin/sites.py @@ -420,14 +420,13 @@ def autocomplete_view(self, request): def catch_all_view(self, request, url): if settings.APPEND_SLASH and not url.endswith('/'): ...
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -6602,6 +6602,42 @@ def test_missing_slash_append_slash_true(self): response = self.client.get(known_url[:-1]) self.assertRedirects(response, known_url, status_code...
catch_all_view() does not support FORCE_SCRIPT_NAME. Description (last modified by SlavaSkvortsov) catch_all_view returns redirect to '%s/' % request.path_info (script name cut off there) instead of '%s/' % request.path (with the script name) Patch - ​https://github.com/django/django/pull/14404
2021-05-17T11:24:06Z
4.0
["test_missing_slash_append_slash_true_force_script_name (admin_views.tests.AdminSiteFinalCatchAllPatternTests)", "test_missing_slash_append_slash_true_script_name (admin_views.tests.AdminSiteFinalCatchAllPatternTests)"]
["test_explicitly_provided_pk (admin_views.tests.GetFormsetsWithInlinesArgumentTest)", "test_implicitly_generated_pk (admin_views.tests.GetFormsetsWithInlinesArgumentTest)", "test_should_be_able_to_edit_related_objects_on_add_view (admin_views.tests.AdminCustomSaveRelatedTests)", "test_should_be_able_to_edit_related_ob...
475cffd1d64c690cdad16ede4d5e81985738ceb4
<15 min fix
154
django/django
django__django-12406
335c9c94acf263901fb023404408880245b0c4b4
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -980,6 +980,7 @@ def formfield(self, *, using=None, **kwargs): 'queryset': self.remote_field.model._default_manager.using(using), ...
diff --git a/tests/model_forms/models.py b/tests/model_forms/models.py --- a/tests/model_forms/models.py +++ b/tests/model_forms/models.py @@ -393,6 +393,9 @@ class Character(models.Model): username = models.CharField(max_length=100) last_action = models.DateTimeField() + def __str__(self): + retu...
ModelForm RadioSelect widget for foreign keys should not present a blank option if blank=False on the model Description Unlike the select widget, where a blank option is idiomatic even for required fields, radioselect has an inherent unfilled state that makes the "-------" option look suspiciously like a valid choice...
A pull request is available here: ​https://github.com/django/django/pull/11199 ​PR
2020-02-02T16:34:05Z
3.1
["test_non_blank_foreign_key_with_radio (model_forms.tests.ModelFormBaseTest)", "test_choices_radio_blank (model_forms.test_modelchoicefield.ModelChoiceFieldTests)", "test_clean_model_instance (model_forms.test_modelchoicefield.ModelChoiceFieldTests)"]
["test_modelform_factory_metaclass (model_forms.tests.CustomMetaclassTestCase)", "test_notrequired_overrides_notblank (model_forms.tests.ValidationTest)", "test_validates_with_replaced_field_excluded (model_forms.tests.ValidationTest)", "test_validates_with_replaced_field_not_specified (model_forms.tests.ValidationTest...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
82
sympy/sympy
sympy__sympy-20590
cffd4e0f86fefd4802349a9f9b19ed70934ea354
diff --git a/sympy/core/_print_helpers.py b/sympy/core/_print_helpers.py --- a/sympy/core/_print_helpers.py +++ b/sympy/core/_print_helpers.py @@ -17,6 +17,11 @@ class Printable: This also adds support for LaTeX printing in jupyter notebooks. """ + # Since this class is used as a mixin we set empty slots...
diff --git a/sympy/core/tests/test_basic.py b/sympy/core/tests/test_basic.py --- a/sympy/core/tests/test_basic.py +++ b/sympy/core/tests/test_basic.py @@ -34,6 +34,12 @@ def test_structure(): assert bool(b1) +def test_immutable(): + assert not hasattr(b1, '__dict__') + with raises(AttributeError): + ...
Symbol instances have __dict__ since 1.7? In version 1.6.2 Symbol instances had no `__dict__` attribute ```python >>> sympy.Symbol('s').__dict__ --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-3-e...
I've bisected the change to 5644df199fdac0b7a44e85c97faff58dfd462a5a from #19425 It seems that Basic now inherits `DefaultPrinting` which I guess doesn't have slots. I'm not sure if it's a good idea to add `__slots__` to that class as it would then affect all subclasses. @eric-wieser I'm not sure if this should cou...
2020-12-12T18:18:38Z
1.7
["test_immutable"]
["test__aresame", "test_structure", "test_equality", "test_matches_basic", "test_has", "test_subs", "test_subs_with_unicode_symbols", "test_atoms", "test_free_symbols_empty", "test_doit", "test_S", "test_xreplace", "test_preorder_traversal", "test_sorted_args", "test_call", "test_rewrite", "test_literal_evalf_is_number...
cffd4e0f86fefd4802349a9f9b19ed70934ea354
15 min - 1 hour
477
django/django
django__django-14915
903aaa35e5ceaa33bfc9b19b7f6da65ce5a91dd4
diff --git a/django/forms/models.py b/django/forms/models.py --- a/django/forms/models.py +++ b/django/forms/models.py @@ -1166,6 +1166,9 @@ def __init__(self, value, instance): def __str__(self): return str(self.value) + def __hash__(self): + return hash(self.value) + def __eq__(self, ot...
diff --git a/tests/model_forms/test_modelchoicefield.py b/tests/model_forms/test_modelchoicefield.py --- a/tests/model_forms/test_modelchoicefield.py +++ b/tests/model_forms/test_modelchoicefield.py @@ -2,7 +2,7 @@ from django import forms from django.core.exceptions import ValidationError -from django.forms.models...
ModelChoiceIteratorValue is not hashable. Description Recently I migrated from Django 3.0 to Django 3.1. In my code, I add custom data-* attributes to the select widget options. After the upgrade some of those options broke. Error is {TypeError}unhashable type: 'ModelChoiceIteratorValue'. Example (this one breaks): ...
Thanks for the ticket. Agreed, we could make ModelChoiceIteratorValue hashable by adding: def __hash__(self): return hash(self.value) For now you can use value.value as ​documented in the "Backwards incompatible changes in 3.1" section. Would you like to prepare a patch? Replying to Mariusz Felisiak: Thanks for the tic...
2021-09-29T22:00:15Z
4.1
["test_choice_value_hash (model_forms.test_modelchoicefield.ModelChoiceFieldTests)"]
["test_basics (model_forms.test_modelchoicefield.ModelChoiceFieldTests)", "test_choice_iterator_passes_model_to_widget (model_forms.test_modelchoicefield.ModelChoiceFieldTests)", "test_choices (model_forms.test_modelchoicefield.ModelChoiceFieldTests)", "test_choices_bool (model_forms.test_modelchoicefield.ModelChoiceFi...
647480166bfe7532e8c471fef0146e3a17e6c0c9
<15 min fix
172
pylint-dev/pylint
pylint-dev__pylint-4604
1e55ae64624d28c5fe8b63ad7979880ee2e6ef3f
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1826,6 +1826,10 @@ def _store_type_annotation_node(self, type_annotation): self._type_annotation_names.append(type_annotation.name) return + ...
diff --git a/tests/checkers/unittest_variables.py b/tests/checkers/unittest_variables.py --- a/tests/checkers/unittest_variables.py +++ b/tests/checkers/unittest_variables.py @@ -21,11 +21,13 @@ import os import re import sys +import unittest from pathlib import Path import astroid from pylint.checkers import...
unused-import false positive for a module used in a type comment ### Steps to reproduce ```python """Docstring.""" import abc from abc import ABC X = ... # type: abc.ABC Y = ... # type: ABC ``` ### Current behavior ``` ************* Module a /tmp/a.py:3:0: W0611: Unused import abc (unused-import)...
2021-06-22T10:44:14Z
2.9
["tests/checkers/unittest_variables.py::TestVariablesChecker::test_bitbucket_issue_78", "tests/checkers/unittest_variables.py::TestVariablesChecker::test_no_name_in_module_skipped", "tests/checkers/unittest_variables.py::TestVariablesChecker::test_all_elements_without_parent", "tests/checkers/unittest_variables.py::Tes...
[]
c04f92ef68e5ea779a60bfddb91dc677c5470fd0
15 min - 1 hour
321
django/django
django__django-12858
f2051eb8a7febdaaa43bd33bf5a6108c5f428e59
diff --git a/django/db/models/base.py b/django/db/models/base.py --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -1747,7 +1747,9 @@ def _check_ordering(cls): else: _cls = None except (FieldDoesNotExist, AttributeError): - ...
diff --git a/tests/invalid_models_tests/test_models.py b/tests/invalid_models_tests/test_models.py --- a/tests/invalid_models_tests/test_models.py +++ b/tests/invalid_models_tests/test_models.py @@ -893,6 +893,15 @@ class Meta: with register_lookup(models.CharField, Lower): self.assertEqual(Model....
models.E015 is raised when ordering uses lookups that are not transforms. Description ./manage.py check SystemCheckError: System check identified some issues: ERRORS: app.Stock: (models.E015) 'ordering' refers to the nonexistent field, related field, or lookup 'supply__product__parent__isnull'. However this ordering ...
2020-05-05T04:49:02Z
3.1
["test_ordering_pointing_to_lookup_not_transform (invalid_models_tests.test_models.OtherModelTests)"]
["test_check_constraints (invalid_models_tests.test_models.ConstraintsTests)", "test_check_constraints_required_db_features (invalid_models_tests.test_models.ConstraintsTests)", "test_deferrable_unique_constraint (invalid_models_tests.test_models.ConstraintsTests)", "test_deferrable_unique_constraint_required_db_featur...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
90
django/django
django__django-15128
cb383753c0e0eb52306e1024d32a782549c27e61
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -572,6 +572,15 @@ def combine(self, rhs, connector): if self.distinct_fields != rhs.distinct_fields: raise TypeError('Cannot combine queries with di...
diff --git a/tests/queries/models.py b/tests/queries/models.py --- a/tests/queries/models.py +++ b/tests/queries/models.py @@ -613,13 +613,14 @@ def __str__(self): class BaseUser(models.Model): - pass + annotation = models.ForeignKey(Annotation, models.CASCADE, null=True, blank=True) class Task(models.M...
Query.change_aliases raises an AssertionError Description Python Version: 3.9.2 Django Version: 2.2.24, 3.2.9 (reproduced using two different versions) Code to Reproduce # models.py from django.db import models class Foo(models.Model): qux = models.ForeignKey("app.Qux", on_delete=models.CASCADE, related_name="foos"...
Thanks for the report. Reproduced at b8c0b22f2f0f8ce664642332d6d872f300c662b4. Vishal Pandey, if you're looking for pointers on how to resolve the issue I think I have a pretty good understanding of the problem. The root cause is that both queries happen to share the same alias_prefix; the letter used generate aliases ...
2021-11-25T15:50:24Z
4.1
["test_conflicting_aliases_during_combine (queries.tests.QuerySetBitwiseOperationTests)"]
["test_ticket14729 (queries.tests.RawQueriesTests)", "test_datetimes_invalid_field (queries.tests.Queries3Tests)", "test_ticket22023 (queries.tests.Queries3Tests)", "test_ticket7107 (queries.tests.Queries3Tests)", "test_21001 (queries.tests.EmptyStringsAsNullTest)", "test_direct_exclude (queries.tests.EmptyStringsAsNul...
647480166bfe7532e8c471fef0146e3a17e6c0c9
1-4 hours
180
sphinx-doc/sphinx
sphinx-doc__sphinx-9258
06107f838c28ab6ca6bfc2cc208e15997fcb2146
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -304,7 +304,7 @@ def make_xref(self, rolename: str, domain: str, target: str, def make_xrefs(self, rolename: str, domain: str, target: str, innernode: Type[TextlikeN...
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -1009,6 +1009,40 @@ def test_info_field_list(app): **{"py:module": "example", "py:class": "Class"}) +def test_info_field_list_piped_type(app): + text = (".. py:module:: e...
[RFE] Support union types specification using | (vertical bar/pipe) Please add a support for specifying multiple types acceptable for a parameter/attribute/variable. Use case: Imagine that there is a function that accepts both `bytes` and `str`. The docstring would look like: ``` restructuredtext def foo(text): ""...
From [the docs](http://www.sphinx-doc.org/en/stable/domains.html#info-field-lists): > Multiple types in a type field will be linked automatically if separated by the word “or”: So this feature is already available using this syntax: ```python def foo(foo): """ Bla blu :type foo: str or int or N...
2021-05-21T16:56:41Z
4.1
["tests/test_domain_py.py::test_info_field_list_piped_type"]
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_xrefs_abbreviations", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_f...
9a2c3c4a1559e37e95fdee88c128bb116642c897
<15 min fix
414
pydata/xarray
pydata__xarray-6599
6bb2b855498b5c68d7cca8cceb710365d58e6048
diff --git a/xarray/core/computation.py b/xarray/core/computation.py --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -1933,7 +1933,8 @@ def _ensure_numeric(data: T_Xarray) -> T_Xarray: from .dataset import Dataset def to_floatable(x: DataArray) -> DataArray: - if x.dtype.kind in ...
diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py --- a/xarray/tests/test_computation.py +++ b/xarray/tests/test_computation.py @@ -2010,6 +2010,14 @@ def test_where_attrs() -> None: ), id="datetime", ), + pytest.param( + xr.DataArray( ...
`polyval` with timedelta64 coordinates produces wrong results ### What happened? I'm not sure if this is a bug or an expected breaking change, but I'm not able to reproduce the results generated by `polyval` using a timedelta64 coordinate. The results are correct in `xarray=2022.3.0`, whereas they are wrong in the l...
As listed in breaking changes, the new polyval algorithm uses the values of the `coord` argument and not the index coordinate. Your coordinate is a Timedelta `values -values[0]`, try using that directly or `azimuth_time.coords["azimuth_time"]`. Thanks - I think I might be misunderstanding how the new implementation wo...
2022-05-12T15:12:41Z
2022.03
["xarray/tests/test_computation.py::test_polyval[timedelta-False]"]
["xarray/tests/test_computation.py::test_signature_properties", "xarray/tests/test_computation.py::test_result_name", "xarray/tests/test_computation.py::test_ordered_set_union", "xarray/tests/test_computation.py::test_ordered_set_intersection", "xarray/tests/test_computation.py::test_join_dict_keys", "xarray/tests/test...
d7931f9014a26e712ff5f30c4082cf0261f045d3
15 min - 1 hour
312
matplotlib/matplotlib
matplotlib__matplotlib-25332
66ba515e671638971bd11a34cff12c107a437e0b
diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -788,6 +788,19 @@ class Grouper: def __init__(self, init=()): self._mapping = {weakref.ref(x): [weakref.ref(x)] for x in init} + def __getstate__(self): + return { + ...
diff --git a/lib/matplotlib/tests/test_pickle.py b/lib/matplotlib/tests/test_pickle.py --- a/lib/matplotlib/tests/test_pickle.py +++ b/lib/matplotlib/tests/test_pickle.py @@ -58,6 +58,7 @@ def _generate_complete_test_figure(fig_ref): # Ensure lists also pickle correctly. plt.subplot(3, 3, 1) plt.plot(lis...
[Bug]: Unable to pickle figure with aligned labels ### Bug summary Unable to pickle figure after calling `align_labels()` ### Code for reproduction ```python import matplotlib.pyplot as plt import pickle fig = plt.figure() ax1 = fig.add_subplot(211) ax2 = fig.add_subplot(212) time=[0,1,2,3,4] speed=[...
As you've noted, pickling is pretty fragile. Do you _need_ to pickle?
2023-02-26T11:18:40Z
3.7
["lib/matplotlib/tests/test_pickle.py::test_complete[png]"]
["lib/matplotlib/tests/test_pickle.py::test_simple", "lib/matplotlib/tests/test_pickle.py::test_gcf", "lib/matplotlib/tests/test_pickle.py::test_no_pyplot", "lib/matplotlib/tests/test_pickle.py::test_renderer", "lib/matplotlib/tests/test_pickle.py::test_image", "lib/matplotlib/tests/test_pickle.py::test_polar", "lib/ma...
0849036fd992a2dd133a0cffc3f84f58ccf1840f
<15 min fix
278
sphinx-doc/sphinx
sphinx-doc__sphinx-10323
31eba1a76dd485dc633cae48227b46879eda5df4
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -224,9 +224,9 @@ def read(self, location: Tuple[str, int] = None) -> Tuple[str, int]: self.start_filter, self.end_filter, ...
diff --git a/tests/test_directive_code.py b/tests/test_directive_code.py --- a/tests/test_directive_code.py +++ b/tests/test_directive_code.py @@ -251,6 +251,19 @@ def test_LiteralIncludeReader_dedent(literal_inc_path): "\n") +@pytest.mark.xfail(os.name != 'posix', reason="Not working on win...
Use of literalinclude prepend results in incorrect indent formatting for code eamples ### Describe the bug Cannot determine a mechanism to use literalinclude directive with `prepend` or `append` to match code example indentation, as leading whitespace is removed. ### How to Reproduce Example of including xml s...
Docutils; the reST parser library ignores the leading whitespaces of directive options. So it's difficult to handle it from directive implementation. >Use of dedent could be a good solution, if dedent was applied only to the literalinclude and not to the prepend and append content. Sounds good. The combination of...
2022-04-02T14:42:24Z
5.0
["tests/test_directive_code.py::test_LiteralIncludeReader_dedent_and_append_and_prepend"]
["tests/test_directive_code.py::test_LiteralIncludeReader", "tests/test_directive_code.py::test_LiteralIncludeReader_lineno_start", "tests/test_directive_code.py::test_LiteralIncludeReader_pyobject1", "tests/test_directive_code.py::test_LiteralIncludeReader_pyobject2", "tests/test_directive_code.py::test_LiteralInclude...
60775ec4c4ea08509eee4b564cbf90f316021aff
<15 min fix
381
sympy/sympy
sympy__sympy-19783
586a43201d0357e92e8c93548d69a9f42bf548f4
diff --git a/sympy/physics/quantum/dagger.py b/sympy/physics/quantum/dagger.py --- a/sympy/physics/quantum/dagger.py +++ b/sympy/physics/quantum/dagger.py @@ -1,8 +1,6 @@ """Hermitian conjugation.""" -from __future__ import print_function, division - -from sympy.core import Expr +from sympy.core import Expr, Mul fr...
diff --git a/sympy/physics/quantum/tests/test_dagger.py b/sympy/physics/quantum/tests/test_dagger.py --- a/sympy/physics/quantum/tests/test_dagger.py +++ b/sympy/physics/quantum/tests/test_dagger.py @@ -1,8 +1,9 @@ -from sympy import I, Matrix, symbols, conjugate, Expr, Integer +from sympy import I, Matrix, symbols, co...
Dagger() * IdentityOperator() is not simplified As discussed on the mailing list the following does not work. ``` from sympy.physics.quantum.dagger import Dagger from sympy.physics.quantum.operator import Operator from sympy.physics.quantum import IdentityOperator A = Operators('A') Identity = IdentityOperator() ...
2020-07-16T09:40:38Z
1.7
["test_dagger_mul", "test_identity"]
["test_scalars", "test_matrix", "test_eval_adjoint", "test_operator", "test_operator_inv", "test_hermitian", "test_unitary", "test_outer_product", "test_operator_dagger"]
cffd4e0f86fefd4802349a9f9b19ed70934ea354
15 min - 1 hour
472
scikit-learn/scikit-learn
scikit-learn__scikit-learn-13496
3aefc834dce72e850bff48689bea3c7dff5f3fad
diff --git a/sklearn/ensemble/iforest.py b/sklearn/ensemble/iforest.py --- a/sklearn/ensemble/iforest.py +++ b/sklearn/ensemble/iforest.py @@ -120,6 +120,12 @@ class IsolationForest(BaseBagging, OutlierMixin): verbose : int, optional (default=0) Controls the verbosity of the tree building process. + ...
diff --git a/sklearn/ensemble/tests/test_iforest.py b/sklearn/ensemble/tests/test_iforest.py --- a/sklearn/ensemble/tests/test_iforest.py +++ b/sklearn/ensemble/tests/test_iforest.py @@ -295,6 +295,28 @@ def test_score_samples(): clf2.score_samples([[2., 2.]])) +@pytest.mark.filterwarnings('...
Expose warm_start in Isolation forest It seems to me that `sklearn.ensemble.IsolationForest` supports incremental addition of new trees with the `warm_start` parameter of its parent class, `sklearn.ensemble.BaseBagging`. Even though this parameter is not exposed in `__init__()` , it gets inherited from `BaseBagging`...
+1 to expose `warm_start` in `IsolationForest`, unless there was a good reason for not doing so in the first place. I could not find any related discussion in the IsolationForest PR #4163. ping @ngoix @agramfort? no objection > PR welcome @petibear. Feel free to ping me when it’s ready for reviews :). OK, I'm workin...
2019-03-23T09:46:59Z
0.21
["sklearn/ensemble/tests/test_iforest.py::test_iforest_warm_start"]
["sklearn/ensemble/tests/test_iforest.py::test_iforest", "sklearn/ensemble/tests/test_iforest.py::test_iforest_sparse", "sklearn/ensemble/tests/test_iforest.py::test_iforest_error", "sklearn/ensemble/tests/test_iforest.py::test_recalculate_max_depth", "sklearn/ensemble/tests/test_iforest.py::test_max_samples_attribute"...
7813f7efb5b2012412888b69e73d76f2df2b50b6
<15 min fix
362
pylint-dev/pylint
pylint-dev__pylint-6386
754b487f4d892e3d4872b6fc7468a71db4e31c13
diff --git a/pylint/config/argument.py b/pylint/config/argument.py --- a/pylint/config/argument.py +++ b/pylint/config/argument.py @@ -457,6 +457,7 @@ def __init__( kwargs: dict[str, Any], hide_help: bool, section: str | None, + metavar: str, ) -> None: super().__init__( ...
diff --git a/tests/config/test_config.py b/tests/config/test_config.py --- a/tests/config/test_config.py +++ b/tests/config/test_config.py @@ -100,3 +100,10 @@ def test_unknown_py_version(capsys: CaptureFixture) -> None: Run([str(EMPTY_MODULE), "--py-version=the-newest"], exit=False) output = capsys.reado...
Argument expected for short verbose option ### Bug description The short option of the `verbose` option expects an argument. Also, the help message for the `verbose` option suggests a value `VERBOSE` should be provided. The long option works ok & doesn't expect an argument: `pylint mytest.py --verbose` ###...
2022-04-19T06:34:57Z
2.14
["tests/config/test_config.py::test_short_verbose"]
["tests/config/test_config.py::test_can_read_toml_env_variable", "tests/config/test_config.py::test_unknown_message_id", "tests/config/test_config.py::test_unknown_option_name", "tests/config/test_config.py::test_unknown_short_option_name", "tests/config/test_config.py::test_unknown_confidence", "tests/config/test_conf...
680edebc686cad664bbed934a490aeafa775f163
15 min - 1 hour
324
sympy/sympy
sympy__sympy-13091
d1320814eda6549996190618a21eaf212cfd4d1e
diff --git a/sympy/core/basic.py b/sympy/core/basic.py --- a/sympy/core/basic.py +++ b/sympy/core/basic.py @@ -313,7 +313,7 @@ def __eq__(self, other): try: other = _sympify(other) except SympifyError: - return False # sympy != other + return N...
diff --git a/sympy/core/tests/test_basic.py b/sympy/core/tests/test_basic.py --- a/sympy/core/tests/test_basic.py +++ b/sympy/core/tests/test_basic.py @@ -38,6 +38,43 @@ def test_equality(): assert Basic() != 0 assert not(Basic() == 0) + class Foo(object): + """ + Class that is unaware of B...
Return NotImplemented, not False, upon rich comparison with unknown type Comparison methods should ideally return ``NotImplemented`` when unable to make sense of the arguments. This way, the comparison is delegated to the reflected method on the other object, which might support the comparison (see https://docs.python....
Classes are generally required to subclass from Basic to interoperate with SymPy. What happens in the test suite if you change it to NotImplemented? Subclassing won't help in this case, it will just move the problem to line 319 (returns ``False`` if sympy types are different). Which is to say, ``NotImplemented`` sh...
2017-08-05T08:04:32Z
1.1
["test_equality", "test_comparisons_with_unknown_type"]
["test_structure", "test_matches_basic", "test_has", "test_subs", "test_atoms", "test_free_symbols_empty", "test_doit", "test_S", "test_xreplace", "test_Singleton", "test_preorder_traversal", "test_sorted_args", "test_call", "test_rewrite", "test_integers_cache", "test_seterr", "test_mod", "test_divmod", "test_igcd", "...
ec9e3c0436fbff934fa84e22bf07f1b3ef5bfac3
15 min - 1 hour
431
pytest-dev/pytest
pytest-dev__pytest-7982
a7e38c5c61928033a2dc1915cbee8caa8544a4d0
diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -558,7 +558,7 @@ def visit( entries = sorted(os.scandir(path), key=lambda entry: entry.name) yield from entries for entry in entries: - if entry.is_dir(follow_symlinks=False) a...
diff --git a/testing/test_collection.py b/testing/test_collection.py --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -9,6 +9,7 @@ from _pytest.main import _in_venv from _pytest.main import Session from _pytest.pathlib import symlink_or_skip +from _pytest.pytester import Pytester from _pytest.py...
Symlinked directories not collected since pytest 6.1.0 When there is a symlink to a directory in a test directory, is is just skipped over, but it should be followed and collected as usual. This regressed in b473e515bc57ff1133fe650f1e7e6d7e22e5d841 (included in 6.1.0). For some reason I added a `follow_symlinks=Fals...
2020-10-31T12:27:03Z
6.2
["testing/test_collection.py::test_collect_symlink_dir"]
["testing/test_collection.py::TestCollector::test_collect_versus_item", "testing/test_collection.py::test_fscollector_from_parent", "testing/test_collection.py::TestCollector::test_check_equality", "testing/test_collection.py::TestCollector::test_getparent", "testing/test_collection.py::TestCollector::test_getcustomfil...
902739cfc3bbc3379e6ef99c8e250de35f52ecde
<15 min fix
347
django/django
django__django-12713
5b884d45ac5b76234eca614d90c83b347294c332
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -249,17 +249,25 @@ def formfield_for_manytomany(self, db_field, request, **kwargs): return None db = kwargs.get('using') - autocomp...
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py --- a/tests/admin_widgets/tests.py +++ b/tests/admin_widgets/tests.py @@ -14,7 +14,9 @@ from django.contrib.auth.models import User from django.core.files.storage import default_storage from django.core.files.uploadedfile import SimpleUploadedF...
Allow overridding widget in formfield_for_manytomany(). Description (last modified by Mariusz Felisiak) It does not work when I set widget param to function formfield_for_manytomany(). This is different from the formfield_for_foreignkey() function.
2020-04-13T23:57:12Z
3.1
["test_formfield_overrides_m2m_filter_widget (admin_widgets.tests.AdminFormfieldForDBFieldTests)"]
["test_CharField (admin_widgets.tests.AdminFormfieldForDBFieldTests)", "test_DateField (admin_widgets.tests.AdminFormfieldForDBFieldTests)", "test_DateTimeField (admin_widgets.tests.AdminFormfieldForDBFieldTests)", "test_EmailField (admin_widgets.tests.AdminFormfieldForDBFieldTests)", "test_FileField (admin_widgets.tes...
0668164b4ac93a5be79f5b87fae83c657124d9ab
15 min - 1 hour
86
django/django
django__django-12209
5a68f024987e6d16c2626a31bf653a2edddea579
diff --git a/django/db/models/base.py b/django/db/models/base.py --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -849,6 +849,7 @@ def _save_table(self, raw=False, cls=None, force_insert=False, updated = False # Skip an UPDATE when adding an instance and primary key has a default. ...
diff --git a/tests/serializers/models/data.py b/tests/serializers/models/data.py --- a/tests/serializers/models/data.py +++ b/tests/serializers/models/data.py @@ -4,6 +4,8 @@ NULL values, where allowed. The basic idea is to have a model for each Django data type. """ +import uuid + from django.contrib.contenttypes....
Change in behaviour when saving a model instance with an explcit pk value if the pk field has a default Description (last modified by Reupen Shah) Consider the following model: from uuid import uuid4 from django.db import models class Sample(models.Model): id = models.UUIDField(primary_key=True, default=uuid4)...
It looks like ​the logic in _save_table should not force an insert if an explicit pk value is provided. The logic should likely take pk_set into account if ( not pk_set and self._state.adding and self._meta.pk.default and self._meta.pk.default is not NOT_PROVIDED ): force_insert = True I'm surprised this was not caught...
2019-12-12T04:11:05Z
3.1
["partial(func, *args, **keywords) - new function with partial application"]
[]
0668164b4ac93a5be79f5b87fae83c657124d9ab
<15 min fix
75
sympy/sympy
sympy__sympy-13798
7121bdf1facdd90d05b6994b4c2e5b2865a4638a
diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py --- a/sympy/printing/latex.py +++ b/sympy/printing/latex.py @@ -155,12 +155,23 @@ def __init__(self, settings=None): "dot": r" \cdot ", "times": r" \times " } - - self._settings['mul_symbol_latex'] = \ - ...
diff --git a/sympy/printing/tests/test_latex.py b/sympy/printing/tests/test_latex.py --- a/sympy/printing/tests/test_latex.py +++ b/sympy/printing/tests/test_latex.py @@ -62,6 +62,8 @@ def test_latex_basic(): assert latex(2*x*y) == "2 x y" assert latex(2*x*y, mul_symbol='dot') == r"2 \cdot x \cdot y" + a...
latex() and mul_symbol The `latex()` pretty-printing function accepts a `mul_symbol` kwarg that must be one of four choices. I would like to be able to supply my own choice which is not in the list. Specifically, I want the multiplication symbol to be `\,` (i.e., a thin space). This is what I mean ``` >>> latex(3*x**...
Your change sounds good to me. It seems to be restricted only because it's a mapping, but it could be set so that an unknown argument is used as the latex.
2017-12-26T18:12:43Z
1.1
["test_latex_basic"]
["test_printmethod", "test_latex_builtins", "test_latex_SingularityFunction", "test_latex_cycle", "test_latex_permutation", "test_latex_Float", "test_latex_vector_expressions", "test_latex_symbols", "test_latex_functions", "test_hyper_printing", "test_latex_bessel", "test_latex_fresnel", "test_latex_brackets", "test_la...
ec9e3c0436fbff934fa84e22bf07f1b3ef5bfac3
15 min - 1 hour
438
astropy/astropy
astropy__astropy-14995
b16c7d12ccbc7b2d20364b89fb44285bcbfede54
diff --git a/astropy/nddata/mixins/ndarithmetic.py b/astropy/nddata/mixins/ndarithmetic.py --- a/astropy/nddata/mixins/ndarithmetic.py +++ b/astropy/nddata/mixins/ndarithmetic.py @@ -520,10 +520,10 @@ def _arithmetic_mask(self, operation, operand, handle_mask, axis=None, **kwds): elif self.mask is None and ope...
diff --git a/astropy/nddata/mixins/tests/test_ndarithmetic.py b/astropy/nddata/mixins/tests/test_ndarithmetic.py --- a/astropy/nddata/mixins/tests/test_ndarithmetic.py +++ b/astropy/nddata/mixins/tests/test_ndarithmetic.py @@ -1310,3 +1310,42 @@ def test_raise_method_not_supported(): # raise error for unsupported ...
In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask ### Description This applies to v5.3. It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2. ...
Welcome to Astropy 👋 and thank you for your first issue! A project member will respond to you as soon as possible; in the meantime, please double-check the [guidelines for submitting issues](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested deta...
2023-06-27T19:48:18Z
5.2
["astropy/nddata/mixins/tests/test_ndarithmetic.py::test_nddata_bitmask_arithmetic"]
["astropy/nddata/mixins/tests/test_ndarithmetic.py::test_arithmetics_data[data10-data20]", "astropy/nddata/mixins/tests/test_ndarithmetic.py::test_arithmetics_data[data11-data21]", "astropy/nddata/mixins/tests/test_ndarithmetic.py::test_arithmetics_data[data12-data22]", "astropy/nddata/mixins/tests/test_ndarithmetic.py...
362f6df12abf9bd769d4915fabf955c993ea22cf
<15 min fix
15