attrs/tests
diabolo-dan 597c3a8adb
Add support for cached_properties to slotted attrs classes. (#1200)
* Add support for cached_properties to slotted attrs classes.

* Remove locking from implementation

* Add test for multiple cached properties and fix bug

* Add changelog file

* Document slotted cached properties

* Add cached_property hypothesis check.

* Only run cached_property imports on python 3.8+

* Use cached _obj_setattr instead of `object.__setattr__`

* Correctly resolve mro for __getattr__ in cached properties

* Use _get_annotations rather than branching on class dict entry

* Optimise __getattr__ code by front loading branching, and injecting locasl variables

* Remove unnecessary `__attrs_original_getattr__` from class dictionary.

---------

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2023-12-08 18:24:25 +00:00
..
__init__.py Apply SPDX IDs 2021-12-27 09:29:09 +01:00
attr_import_star.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
dataclass_transform_example.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
strategies.py Add support for cached_properties to slotted attrs classes. (#1200) 2023-12-08 18:24:25 +00:00
test_3rd_party.py Add support for cached_properties to slotted attrs classes. (#1200) 2023-12-08 18:24:25 +00:00
test_abc.py Add unstable Python 3.12 to CI allowing failures (#1033) 2022-12-18 10:46:08 +00:00
test_annotations.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
test_cmp.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
test_compat.py Allow subclassing of AttrsInstance and Protocol at once (#1172) 2023-08-06 21:33:03 +02:00
test_config.py Drop Python 2.7 (#936) 2022-03-21 08:47:47 +01:00
test_converters.py Drop Python 2.7 (#936) 2022-03-21 08:47:47 +01:00
test_dunders.py Pass args from `__init__` to `__attrs_pre_init__` if requested (#1187) 2023-09-29 08:47:51 +02:00
test_filters.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
test_funcs.py Fix TypeError for `asdict(<class with namedtuple>, retain_collection_types=True)` (#1165) 2023-07-29 21:31:36 +02:00
test_functional.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
test_hooks.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
test_import.py Drop Python 2.7 (#936) 2022-03-21 08:47:47 +01:00
test_init_subclass.py Demonstrate init subclass workaround 2023-06-27 07:12:37 +02:00
test_make.py Add optional namespace arguments for `make_class` (#1203) 2023-11-28 12:05:46 +00:00
test_mypy.yml Fix mypy and pyright tests in CI (#1202) 2023-11-11 10:45:04 +00:00
test_next_gen.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
test_packaging.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
test_pattern_matching.py Drop Python 2.7 (#936) 2022-03-21 08:47:47 +01:00
test_pyright.py Fix mypy and pyright tests in CI (#1202) 2023-11-11 10:45:04 +00:00
test_setattr.py Purge stale Python 2/3 mentions 2022-12-18 10:54:37 +01:00
test_slots.py Add support for cached_properties to slotted attrs classes. (#1200) 2023-12-08 18:24:25 +00:00
test_utils.py Make tests for simple-class actually run 2022-08-22 10:54:22 +02:00
test_validators.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
test_version_info.py Drop Python 2.7 (#936) 2022-03-21 08:47:47 +01:00
typing_example.py Tighten linting (#1175) 2023-08-20 12:03:53 +02:00
utils.py Add Attribute.alias (#950) 2022-11-30 14:39:57 +00:00