worktoy 1.2.1.dev0__tar.gz → 1.2.1.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/PKG-INFO +2 -2
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/README.md +1 -1
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/pyproject.toml +1 -1
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/__init__.py +1 -1
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/_base_test.py +118 -63
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/_complex_mixin.py +41 -6
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/_complex_test.py +1 -1
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/_sub_test.py +24 -8
- worktoy-1.2.1.dev2/src/worktoy/work_test/_test_meta.py +139 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/_test_space.py +11 -10
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/__init__.py +2 -2
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/_base_sampler.py +184 -60
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/_int_sampler.py +47 -7
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/_lorem_text.py +90 -17
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/_sampler_meta.py +8 -6
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/_symbolic_sampler.py +4 -5
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy.egg-info/PKG-INFO +2 -2
- worktoy-1.2.1.dev0/src/worktoy/work_test/_test_meta.py +0 -123
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/LICENSE +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/setup.cfg +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/_instance_owner.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/_meta_type.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/_object.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/control_flow/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/control_flow/_control_flow.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/control_flow/_control_space.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/control_flow/_meta_flow.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/control_flow/_skip_set.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/sentinels/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/sentinels/_args.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/sentinels/_deleted.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/sentinels/_desc.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/sentinels/_meta_call.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/sentinels/_owner.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/sentinels/_sentinel.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/core/sentinels/_this.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/desc/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/desc/_alias.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/desc/_attri_box.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/desc/_base_descriptor.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/desc/_fast_box.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/desc/_field.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/desc/_fix_box.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/desc/_root_alias.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/desc/_symbolic_name.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/dispatch/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/dispatch/_call_me_maybe.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/dispatch/_dispatcher.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/dispatch/_flex_call.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/dispatch/_overload.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/dispatch/_permuter.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/dispatch/_permuter_method.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/dispatch/_type_sig.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/ezdata/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/ezdata/_ez_data.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/ezdata/_ez_field.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/ezdata/_ez_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/ezdata/_ez_meta.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/ezdata/_ez_space.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/ezdata/_ez_store.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/ezdata/_fields.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_access_num.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_box.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_flag.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_flags.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_flags_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_flags_meta.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_flags_space.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_member.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_meta.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_meta_meta.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_num.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_space.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/keenum/_kee_space_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/lorem_ipsum/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/lorem_ipsum/_base_generator.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/lorem_ipsum/_clause.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/lorem_ipsum/_gaussian_lengths.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/lorem_ipsum/_paragraph.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/lorem_ipsum/_sentence.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/lorem_ipsum/_stochastic_variable.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/lorem_ipsum/_stochastic_word.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/lorem_ipsum/_words.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/_abstract_metaclass.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/_abstract_namespace.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/_base_meta.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/_base_object.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/_base_space.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/space_hooks/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/space_hooks/_abstract_space_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/space_hooks/_flex_call_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/space_hooks/_load_space_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/space_hooks/_name_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/space_hooks/_reserved_names.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/space_hooks/_reserved_namespace_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/mcls/space_hooks/_space_desc.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/py.typed +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_args_count.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_bipartite_matching.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_class_body_template.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_directory.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_exception_info.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_join_words.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_maybe.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_quick_desc.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_replace_flex.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_resolve_mro.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_slice_len.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_string_list.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_text_fmt.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_type_cast.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_unpack.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_valid_slice.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/_word_wrap.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/combinatorics/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/combinatorics/_arrangement.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/combinatorics/_arrangements.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/utilities/combinatorics/_index_permutations.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_alternative_warning.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_deprecated_promise.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_missing_variable.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_redundant_keyword.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_risk_warning.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_subclass_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_type_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_uncheckable_type.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_unpack_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_variable_not_none.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_work_toy_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/_work_toy_warning.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/control_flow/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_access_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_dangling_alias.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_descriptor_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_missing_instance_dict.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_nameless_callback.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_not_a_descriptor.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_overload_reference.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_phantom_box_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_protected_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_read_only_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_recursive_read.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_reference_conflict.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_shared_descriptor.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_without_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/desc/_write_once_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/dispatch/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/dispatch/_bare_overload.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/dispatch/_dispatch_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/dispatch/_duplicate_signature.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/dispatch/_type_cast_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/dispatch/_unbound_cast_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_class_field_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_duplicate_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_extra_keyword_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_extra_positional_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_incomplete_field_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_kw_only_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_repeated_field_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_reserved_attribute_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_reserved_field_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/ezdata/_reserved_method_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_box_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_box_type_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_box_value_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_case_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_duplicate.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_flag_duplicate.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_flag_name_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_member_name_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_name_conflict.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_resolve_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_type_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/keenum/_kee_write_once_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_claimed_name.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_control_class_error.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_del_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_duplicate_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_duplicate_sentinel.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_hook_exception.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_illegal_instantiation.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_mixed_method_kind.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_overload_conflict.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_questionable_syntax.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_rebound_overload.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_reserved_name.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_shadowed_class_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_slots_refused.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/waitaminute/meta/_unbound_class_hook.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/__init__.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/_float_sampler.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/_gaussian_sampler.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/_lorem_sampler.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy/work_test/samplers/_word_sampler.py +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy.egg-info/SOURCES.txt +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy.egg-info/dependency_links.txt +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/src/worktoy.egg-info/top_level.txt +0 -0
- {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev2}/tests/test_smoke.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: worktoy
|
|
3
|
-
Version: 1.2.1.
|
|
3
|
+
Version: 1.2.1.dev2
|
|
4
4
|
Summary: Declarative structure for Python that enforces types at runtime and enables true function overloading
|
|
5
5
|
Author-email: Asger Jon Vistisen <asgerjon2@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -32,7 +32,7 @@ Dynamic: license-file
|
|
|
32
32
|
[](https://pypi.org/project/worktoy/)
|
|
33
33
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
34
34
|
|
|
35
|
-
# worktoy v1.2.1-
|
|
35
|
+
# worktoy v1.2.1-dev2 (development build)
|
|
36
36
|
|
|
37
37
|
**worktoy** provides utilities for Python development focused on
|
|
38
38
|
reducing boilerplate while improving type safety and readability. Each
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://pypi.org/project/worktoy/)
|
|
5
5
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
6
|
|
|
7
|
-
# worktoy v1.2.1-
|
|
7
|
+
# worktoy v1.2.1-dev2 (development build)
|
|
8
8
|
|
|
9
9
|
**worktoy** provides utilities for Python development focused on
|
|
10
10
|
reducing boilerplate while improving type safety and readability. Each
|
|
@@ -48,7 +48,7 @@ and the enclosing class is left without the decoration.
|
|
|
48
48
|
# Copyright (c) 2025-2026 Asger Jon Vistisen
|
|
49
49
|
from __future__ import annotations
|
|
50
50
|
|
|
51
|
-
__version__ = '1.2.1-
|
|
51
|
+
__version__ = '1.2.1-dev2'
|
|
52
52
|
|
|
53
53
|
from . import utilities
|
|
54
54
|
from . import waitaminute
|
|
@@ -5,9 +5,7 @@ BaseTest is the 'unittest.TestCase' subclass shared by the worktoy tests.
|
|
|
5
5
|
# Copyright (c) 2025-2026 Asger Jon Vistisen
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
import gc
|
|
9
8
|
import os
|
|
10
|
-
import sys
|
|
11
9
|
import traceback
|
|
12
10
|
from functools import wraps
|
|
13
11
|
from inspect import iscoroutinefunction
|
|
@@ -35,11 +33,9 @@ try:
|
|
|
35
33
|
except AttributeError: # pragma: no cover, no mutate
|
|
36
34
|
class _Temp(TestCase):
|
|
37
35
|
def assertIsSubclass(self, cls: type, base: type, msg=None) -> None:
|
|
38
|
-
"""Asserts that 'cls' is a subclass of 'base'."""
|
|
39
36
|
self.assertTrue(issubclass(cls, base), msg)
|
|
40
37
|
|
|
41
38
|
def assertNotIsSubclass(self, cls: type, base: type, msg=None) -> None:
|
|
42
|
-
"""Asserts that 'cls' is not a subclass of 'base'."""
|
|
43
39
|
self.assertFalse(issubclass(cls, base), msg)
|
|
44
40
|
else: # version >= 3.14
|
|
45
41
|
_Temp = TestCase
|
|
@@ -200,19 +196,16 @@ class BaseTest(_Temp, metaclass=BaseMeta):
|
|
|
200
196
|
one instance of a test class per test method gives each test samplers
|
|
201
197
|
of its own, built at the first read, and a sampler narrowed or seeded
|
|
202
198
|
in 'setUp' keeps its settings for that test alone; 'seedSamplers'
|
|
203
|
-
seeds all six with one seed. 'subTest' is the
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
'
|
|
213
|
-
garbage collector after its tests, for the reason its docstring
|
|
214
|
-
gives. 'exceptions' yields the common builtin exception classes.
|
|
215
|
-
'argReport'
|
|
199
|
+
seeds all six with one seed. 'subTest' is the 'SubTest' descriptor,
|
|
200
|
+
which builds one accumulator per test instance; '_reportSubTests'
|
|
201
|
+
reads it without building one and fails the test once, with
|
|
202
|
+
'FAIL [label]: message' or 'ERROR [label]: repr' per recorded block,
|
|
203
|
+
each followed by the traceback of what the block raised.
|
|
204
|
+
'__class_init__' gives every test class test methods that run it as
|
|
205
|
+
they end, and a 'doCleanups' and a 'debug' that run it for what a
|
|
206
|
+
'tearDown' or a cleanup recorded, so a 'tearDown', a 'doCleanups', a
|
|
207
|
+
'debug' or a 'run' of a test class need not hand on for it.
|
|
208
|
+
'exceptions' yields the common builtin exception classes. 'argReport'
|
|
216
209
|
puts each argument on a line of its own as '<type: value>'.
|
|
217
210
|
'assertIsNotSubclass' and 'assertIsNotInstance' are the negative
|
|
218
211
|
assertions under the names the suite uses; below Python 3.14 the
|
|
@@ -267,12 +260,39 @@ class BaseTest(_Temp, metaclass=BaseMeta):
|
|
|
267
260
|
@classmethod
|
|
268
261
|
def argReport(cls, *args, **kwargs) -> str:
|
|
269
262
|
"""
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
263
|
+
A failing assertion on several values is read best with each value
|
|
264
|
+
on a line of its own, named by its type and short enough to take in
|
|
265
|
+
at a glance, and a test should not have to build such a message by
|
|
266
|
+
hand.
|
|
267
|
+
|
|
268
|
+
Implementation
|
|
269
|
+
--------------
|
|
270
|
+
|
|
271
|
+
Each positional argument becomes '<type: value>', the value as 'str'
|
|
272
|
+
gives it. A line as long as the limit or longer is cut to three
|
|
273
|
+
characters fewer and closed with an ellipsis, so it is as long as
|
|
274
|
+
the limit. The lines are joined by the line separator, each after
|
|
275
|
+
the first indented by two spaces. The text passes through 'textFmt',
|
|
276
|
+
so a run of whitespace inside a value shows as one space, and a
|
|
277
|
+
'<br>' or a '<tab>' in a value is expanded.
|
|
278
|
+
|
|
279
|
+
Parameters
|
|
280
|
+
----------
|
|
281
|
+
|
|
282
|
+
*args
|
|
283
|
+
The values to report.
|
|
284
|
+
|
|
285
|
+
**kwargs
|
|
286
|
+
chars : int, optional
|
|
287
|
+
The limit of a line. Defaults to 48.
|
|
288
|
+
newLine : str, optional
|
|
289
|
+
The line separator. Defaults to 'os.linesep'.
|
|
290
|
+
|
|
291
|
+
Returns
|
|
292
|
+
-------
|
|
293
|
+
|
|
294
|
+
str
|
|
295
|
+
The report, empty when no argument is given.
|
|
276
296
|
"""
|
|
277
297
|
if 'chars' in kwargs:
|
|
278
298
|
lineLength: int = kwargs['chars']
|
|
@@ -299,10 +319,31 @@ class BaseTest(_Temp, metaclass=BaseMeta):
|
|
|
299
319
|
|
|
300
320
|
def seedSamplers(self, seed: int) -> None:
|
|
301
321
|
"""
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
322
|
+
A test drawing random data must be able to draw the same data again,
|
|
323
|
+
at the next run and on another machine, or a failure seen once
|
|
324
|
+
cannot be looked at twice. The test has six samplers, and one line
|
|
325
|
+
should seed them all.
|
|
326
|
+
|
|
327
|
+
Implementation
|
|
328
|
+
--------------
|
|
329
|
+
|
|
330
|
+
The seed is assigned to 'seed' of each of the six samplers,
|
|
331
|
+
'randomInteger' first, which seeds the generator of that sampler. A
|
|
332
|
+
test calling the method in its 'setUp' repeats its draws at every
|
|
333
|
+
run.
|
|
334
|
+
|
|
335
|
+
Parameters
|
|
336
|
+
----------
|
|
337
|
+
|
|
338
|
+
seed : int
|
|
339
|
+
The seed every sampler receives.
|
|
340
|
+
|
|
341
|
+
Raises
|
|
342
|
+
------
|
|
343
|
+
|
|
344
|
+
TypeException
|
|
345
|
+
'seed' is no 'int'. The first sampler refuses it, so none is
|
|
346
|
+
seeded.
|
|
306
347
|
"""
|
|
307
348
|
samplers = (
|
|
308
349
|
self.randomInteger,
|
|
@@ -318,40 +359,33 @@ class BaseTest(_Temp, metaclass=BaseMeta):
|
|
|
318
359
|
@staticmethod
|
|
319
360
|
def _formatRaised(exception: BaseException) -> str:
|
|
320
361
|
"""
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
362
|
+
A failed block is caught where it happens, and its report must still
|
|
363
|
+
name the line that raised, as the traceback of an uncaught exception
|
|
364
|
+
does.
|
|
365
|
+
|
|
366
|
+
Implementation
|
|
367
|
+
--------------
|
|
368
|
+
|
|
369
|
+
'traceback.format_exception' renders the exception with the
|
|
370
|
+
traceback it carries, and the trailing whitespace is dropped.
|
|
371
|
+
|
|
372
|
+
Parameters
|
|
373
|
+
----------
|
|
374
|
+
|
|
375
|
+
exception : BaseException
|
|
376
|
+
What a block raised.
|
|
377
|
+
|
|
378
|
+
Returns
|
|
379
|
+
-------
|
|
380
|
+
|
|
381
|
+
str
|
|
382
|
+
The traceback as the interpreter prints it.
|
|
324
383
|
"""
|
|
325
384
|
lines = traceback.format_exception(
|
|
326
385
|
type(exception), exception, exception.__traceback__,
|
|
327
386
|
)
|
|
328
387
|
return str.join('', lines).rstrip()
|
|
329
388
|
|
|
330
|
-
@classmethod
|
|
331
|
-
def tearDownClass(cls) -> None:
|
|
332
|
-
"""
|
|
333
|
-
Unloads the test module and runs the garbage collector to evict
|
|
334
|
-
the class object before the next test class is built.
|
|
335
|
-
|
|
336
|
-
This is here because 'unittest' pins every test class it discovers
|
|
337
|
-
for the entire run via 'TestLoader' and 'TestResult', and that
|
|
338
|
-
pinning causes real, observable metaclass context leakage between
|
|
339
|
-
otherwise-independent test classes. Run TestA and TestB in
|
|
340
|
-
isolation: both pass. Run them in sequence: TestB inherits stale
|
|
341
|
-
descriptor state, mismatched owners, or cached registry entries
|
|
342
|
-
that 'unittest' has refused to release. Popping the module from
|
|
343
|
-
sys.modules and forcing a GC pass drops the refcount on the
|
|
344
|
-
outgoing class so its metaclass finalizers actually fire before
|
|
345
|
-
the next class's body executes. The bug only exists in the
|
|
346
|
-
intersection of two innocent tests, which is why this looks
|
|
347
|
-
paranoid until you have spent a weekend debugging it.
|
|
348
|
-
|
|
349
|
-
Blame: 'unittest'. The metaclass machinery is fine.
|
|
350
|
-
"""
|
|
351
|
-
super().tearDownClass()
|
|
352
|
-
sys.modules.pop(cls.__module__, None)
|
|
353
|
-
gc.collect()
|
|
354
|
-
|
|
355
389
|
@classmethod
|
|
356
390
|
def __class_init__(cls, name: str, bases: tuple, space, **kw) -> None:
|
|
357
391
|
"""
|
|
@@ -423,14 +457,35 @@ class BaseTest(_Temp, metaclass=BaseMeta):
|
|
|
423
457
|
|
|
424
458
|
def _reportSubTests(self, ) -> None:
|
|
425
459
|
"""
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
460
|
+
A failed 'subTest' block is swallowed where it happens, so that the
|
|
461
|
+
rest of the test runs, and the test must still fail for it
|
|
462
|
+
afterwards. One failure must carry every block recorded since the
|
|
463
|
+
last report, and tell of each what is needed to find it: its label,
|
|
464
|
+
what it raised and the line that raised it. A test that recorded
|
|
465
|
+
nothing, or never opened a block, must pass through untouched. And
|
|
466
|
+
since the report is asked for at more than one moment of a test,
|
|
467
|
+
nothing may be reported twice.
|
|
468
|
+
|
|
469
|
+
Implementation
|
|
470
|
+
--------------
|
|
471
|
+
|
|
472
|
+
The accumulator is read through the 'subTest' descriptor in the way
|
|
473
|
+
that builds none, and a test without one returns at once, as does
|
|
474
|
+
one whose accumulator holds no fail and no error. Otherwise the
|
|
475
|
+
message gets 'FAIL [label]: message' for each fail and
|
|
476
|
+
'ERROR [label]: repr' for each error, each followed by its traceback
|
|
477
|
+
from '_formatRaised'; the accumulator is removed from the instance,
|
|
478
|
+
and 'fail' raises the message. Every test method a test class is
|
|
479
|
+
given calls this method as it ends, the 'doCleanups' it is given
|
|
480
|
+
runs it after the cleanups of the test, and the 'debug' it is given
|
|
481
|
+
calls it at its end; '__class_init__' gives the class the three.
|
|
482
|
+
|
|
483
|
+
Raises
|
|
484
|
+
------
|
|
485
|
+
|
|
486
|
+
AssertionError
|
|
487
|
+
A block failed or raised since the last report. The exception is
|
|
488
|
+
the 'failureException' of the test.
|
|
434
489
|
"""
|
|
435
490
|
cls = type(self)
|
|
436
491
|
try:
|
|
@@ -140,10 +140,33 @@ class ComplexMixin:
|
|
|
140
140
|
@classmethod
|
|
141
141
|
def _resolveOther(cls, other: Any) -> Union[NotImpType, Self]:
|
|
142
142
|
"""
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
Every operator of the mixin takes its other operand in several
|
|
144
|
+
shapes, and must defer to that operand, as Python expects of an
|
|
145
|
+
operator, when it can make nothing of the value. One place decides
|
|
146
|
+
what counts as an operand, so the operators agree.
|
|
147
|
+
|
|
148
|
+
Implementation
|
|
149
|
+
--------------
|
|
150
|
+
|
|
151
|
+
An instance of the class is returned as it is. A real number and a
|
|
152
|
+
'complex' give their parts. A string goes to the constructor, which
|
|
153
|
+
parses it as 'complex' does. Any other value is unpacked as the
|
|
154
|
+
parts when it can be iterated, and handed to the constructor whole
|
|
155
|
+
when it cannot. A value the constructor refuses with 'TypeError' or
|
|
156
|
+
'ValueError' gives 'NotImplemented'.
|
|
157
|
+
|
|
158
|
+
Parameters
|
|
159
|
+
----------
|
|
160
|
+
|
|
161
|
+
other : Any
|
|
162
|
+
The other operand.
|
|
163
|
+
|
|
164
|
+
Returns
|
|
165
|
+
-------
|
|
166
|
+
|
|
167
|
+
Self or NotImplemented
|
|
168
|
+
An instance of the class holding the parts of 'other', or
|
|
169
|
+
'NotImplemented' when 'other' is no operand.
|
|
147
170
|
"""
|
|
148
171
|
if isinstance(other, cls):
|
|
149
172
|
return other
|
|
@@ -172,8 +195,20 @@ class ComplexMixin:
|
|
|
172
195
|
|
|
173
196
|
def conjugate(self) -> Self:
|
|
174
197
|
"""
|
|
175
|
-
|
|
176
|
-
|
|
198
|
+
'complex' offers its conjugate as a method, and a class standing for
|
|
199
|
+
a complex number is expected to offer the same.
|
|
200
|
+
|
|
201
|
+
Implementation
|
|
202
|
+
--------------
|
|
203
|
+
|
|
204
|
+
A new instance of the class holds the same real part and the
|
|
205
|
+
negated imaginary part, as the '~' operator gives.
|
|
206
|
+
|
|
207
|
+
Returns
|
|
208
|
+
-------
|
|
209
|
+
|
|
210
|
+
Self
|
|
211
|
+
The conjugate.
|
|
177
212
|
"""
|
|
178
213
|
cls = type(self)
|
|
179
214
|
out = cls(self.REAL, -self.IMAG)
|
|
@@ -32,7 +32,7 @@ class ComplexTest:
|
|
|
32
32
|
--------------
|
|
33
33
|
|
|
34
34
|
'ComplexTest' has no base of its own, so no loader collects the bank
|
|
35
|
-
itself and no test
|
|
35
|
+
itself and no test file importing it pays twenty-five skipped
|
|
36
36
|
tests; the assertions and 'subTest' come from the test case listed
|
|
37
37
|
after it. The twenty-five test methods are each a loop over 'targets'
|
|
38
38
|
with one block of 'subTest' per target labelled by the target's name,
|
|
@@ -30,8 +30,8 @@ class SubTest(TestCase):
|
|
|
30
30
|
block's label, lets the test method run to its end, and leaves it to
|
|
31
31
|
'BaseTest' to fail the test there with every record and its traceback,
|
|
32
32
|
whatever the test class does in 'tearDown' or 'doCleanups'. 'BaseTest'
|
|
33
|
-
hosts it as the 'subTest' descriptor, so a test
|
|
34
|
-
|
|
33
|
+
hosts it as the 'subTest' descriptor, so a test writes
|
|
34
|
+
'with self.subTest(target=x):' as it would with 'unittest'.
|
|
35
35
|
|
|
36
36
|
Implementation
|
|
37
37
|
--------------
|
|
@@ -66,8 +66,10 @@ class SubTest(TestCase):
|
|
|
66
66
|
__fallback_current__: str = '<sub test>'
|
|
67
67
|
|
|
68
68
|
# Private Variables
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
# The descriptor holds the name 'BaseTest' places it at and 'BaseTest'
|
|
70
|
+
# itself; an accumulator holds '__sub_test__' and its test class.
|
|
71
|
+
__field_name__: Optional[str] = None
|
|
72
|
+
__field_owner__: Optional[Type[BaseTest]] = None
|
|
71
73
|
__current_tests__: Optional[tuple[str, ...]] = None
|
|
72
74
|
__test_fails__: Optional[tuple[AssertionError, ...]] = None
|
|
73
75
|
__test_errors__: Optional[tuple[Exception, ...]] = None
|
|
@@ -179,16 +181,30 @@ class SubTest(TestCase):
|
|
|
179
181
|
|
|
180
182
|
def _addFail(self, fail: AssertionError) -> None:
|
|
181
183
|
"""
|
|
182
|
-
The
|
|
183
|
-
|
|
184
|
+
The report names each failed block, so a fail must be kept together
|
|
185
|
+
with the label of the block that raised it.
|
|
186
|
+
|
|
187
|
+
Implementation
|
|
188
|
+
--------------
|
|
189
|
+
|
|
190
|
+
The fail joins 'fails', and the chained label of the block in
|
|
191
|
+
progress joins 'failLabels' at the same position, '<sub test>' when
|
|
192
|
+
no block is open.
|
|
184
193
|
"""
|
|
185
194
|
self.__test_fails__ = (*self.fails, fail)
|
|
186
195
|
self.__fail_labels__ = (*self.failLabels, self.current)
|
|
187
196
|
|
|
188
197
|
def _addError(self, error: Exception) -> None:
|
|
189
198
|
"""
|
|
190
|
-
|
|
191
|
-
|
|
199
|
+
An error is kept with the label of its block as a fail is, and apart
|
|
200
|
+
from the fails, since the report tells an assertion that failed from
|
|
201
|
+
an exception nobody expected.
|
|
202
|
+
|
|
203
|
+
Implementation
|
|
204
|
+
--------------
|
|
205
|
+
|
|
206
|
+
The error joins 'errors', and the chained label of the block in
|
|
207
|
+
progress joins 'errorLabels' at the same position.
|
|
192
208
|
"""
|
|
193
209
|
self.__test_errors__ = (*self.errors, error)
|
|
194
210
|
self.__error_labels__ = (*self.errorLabels, self.current)
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"""
|
|
2
|
+
TestMeta is a metaclass a test base may choose. Under it, a class body
|
|
3
|
+
that binds 'doCleanups' or 'debug' is refused at that line.
|
|
4
|
+
"""
|
|
5
|
+
# Apache-2.0 license
|
|
6
|
+
# Copyright (c) 2026 Asger Jon Vistisen
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import TYPE_CHECKING
|
|
10
|
+
from unittest import TestCase
|
|
11
|
+
|
|
12
|
+
from . import TestSpace
|
|
13
|
+
from ..mcls import BaseMeta
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING: # pragma: no cover, no mutate
|
|
16
|
+
from typing import Any, Callable
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class TestMeta(BaseMeta):
|
|
20
|
+
"""
|
|
21
|
+
'BaseTest' reports the failed 'subTest' blocks of a test from three
|
|
22
|
+
places: each test method as it ends, 'doCleanups' after the cleanups
|
|
23
|
+
of the test, and 'debug' at its end. It gives every test class a
|
|
24
|
+
'doCleanups' and a 'debug' that report, built around the ones the
|
|
25
|
+
class writes itself when it writes any, so a class that writes its
|
|
26
|
+
own loses no report. A test base may still prefer that the bodies of
|
|
27
|
+
its test classes leave the two names alone, and that a body binding
|
|
28
|
+
one is refused at that line. TestMeta is the metaclass such a base
|
|
29
|
+
chooses. 'BaseTest' itself is not built by it, so that a test base
|
|
30
|
+
may bring any metaclass based on 'BaseMeta'.
|
|
31
|
+
|
|
32
|
+
class StrictTest(BaseTest, metaclass=TestMeta):
|
|
33
|
+
pass
|
|
34
|
+
|
|
35
|
+
class TestDice(StrictTest):
|
|
36
|
+
|
|
37
|
+
def doCleanups(self) -> None: # refused here, with 'ReservedName'
|
|
38
|
+
self.table.close()
|
|
39
|
+
|
|
40
|
+
Implementation
|
|
41
|
+
--------------
|
|
42
|
+
|
|
43
|
+
'__prepare__' returns a 'TestSpace' in which 'doCleanups' and 'debug'
|
|
44
|
+
are bound already, to the functions '_doCleanupsFactory' and
|
|
45
|
+
'_debugFactory' make, and which refuses a class body binding either
|
|
46
|
+
name. The 'doCleanups' placed registers 'BaseTest._reportSubTests'
|
|
47
|
+
with 'addCleanup' and calls 'TestCase.doCleanups': an exception
|
|
48
|
+
raised in 'doCleanups' itself would leave 'TestCase.run', where one
|
|
49
|
+
raised by a registered cleanup is collected as a failure of the test.
|
|
50
|
+
Registered last, the report runs first, before the cleanups of the
|
|
51
|
+
test. The 'debug' placed calls 'TestCase.debug' and then the report,
|
|
52
|
+
whose exception leaves 'debug' as any exception of the test does.
|
|
53
|
+
'BaseTest.__class_init__' builds its own 'doCleanups' and 'debug'
|
|
54
|
+
around the two, as around any a class body binds, so those are what
|
|
55
|
+
the class holds in its '__dict__', and the report runs once more
|
|
56
|
+
after the cleanups of the test, for a block that failed inside one.
|
|
57
|
+
Only the class body is refused: a name assigned on the class after
|
|
58
|
+
the class statement is not.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
@staticmethod
|
|
62
|
+
def _doCleanupsFactory() -> Callable:
|
|
63
|
+
"""
|
|
64
|
+
Every class 'TestMeta' builds must find a 'doCleanups' of the
|
|
65
|
+
library in its namespace before its body runs.
|
|
66
|
+
|
|
67
|
+
Implementation
|
|
68
|
+
--------------
|
|
69
|
+
|
|
70
|
+
A new function is made at each call, so each class holds one of its
|
|
71
|
+
own. It registers 'BaseTest._reportSubTests' as a cleanup, the last,
|
|
72
|
+
and returns what 'TestCase.doCleanups' returns.
|
|
73
|
+
|
|
74
|
+
Returns
|
|
75
|
+
-------
|
|
76
|
+
|
|
77
|
+
Callable
|
|
78
|
+
Called as '(self)': the 'doCleanups' of one test class.
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
def doCleanups(self: Any) -> bool:
|
|
82
|
+
self.addCleanup(self._reportSubTests)
|
|
83
|
+
return TestCase.doCleanups(self)
|
|
84
|
+
|
|
85
|
+
return doCleanups
|
|
86
|
+
|
|
87
|
+
@staticmethod
|
|
88
|
+
def _debugFactory() -> Callable:
|
|
89
|
+
"""
|
|
90
|
+
Every class 'TestMeta' builds must find a 'debug' of the library in
|
|
91
|
+
its namespace before its body runs, as it finds a 'doCleanups'.
|
|
92
|
+
|
|
93
|
+
Implementation
|
|
94
|
+
--------------
|
|
95
|
+
|
|
96
|
+
A new function is made at each call, so each class holds one of its
|
|
97
|
+
own. It calls 'TestCase.debug', which collects no errors and runs no
|
|
98
|
+
'doCleanups', and then 'BaseTest._reportSubTests'.
|
|
99
|
+
|
|
100
|
+
Returns
|
|
101
|
+
-------
|
|
102
|
+
|
|
103
|
+
Callable
|
|
104
|
+
Called as '(self)': the 'debug' of one test class.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
def debug(self: Any) -> None:
|
|
108
|
+
TestCase.debug(self)
|
|
109
|
+
self._reportSubTests()
|
|
110
|
+
|
|
111
|
+
return debug
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def __prepare__(mcls, name: str, bases: tuple, **kwargs) -> TestSpace:
|
|
115
|
+
"""
|
|
116
|
+
The namespace of a test class holds the library's 'doCleanups' and
|
|
117
|
+
'debug' before the first line of the class body runs.
|
|
118
|
+
|
|
119
|
+
Parameters
|
|
120
|
+
----------
|
|
121
|
+
|
|
122
|
+
name : str
|
|
123
|
+
The name of the class.
|
|
124
|
+
|
|
125
|
+
bases : tuple
|
|
126
|
+
The bases of the class.
|
|
127
|
+
|
|
128
|
+
Returns
|
|
129
|
+
-------
|
|
130
|
+
|
|
131
|
+
TestSpace
|
|
132
|
+
The namespace, with 'doCleanups' and 'debug' bound.
|
|
133
|
+
"""
|
|
134
|
+
space = TestSpace(mcls, name, bases, **kwargs)
|
|
135
|
+
doCleanups = mcls._doCleanupsFactory()
|
|
136
|
+
space.__setitem__('doCleanups', doCleanups, _root=True)
|
|
137
|
+
debug = mcls._debugFactory()
|
|
138
|
+
space.__setitem__('debug', debug, _root=True)
|
|
139
|
+
return space
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
|
-
TestSpace is the namespace a test class
|
|
3
|
-
'doCleanups' and 'debug' for the library.
|
|
2
|
+
TestSpace is the namespace 'TestMeta' prepares for a test class. It
|
|
3
|
+
keeps the names 'doCleanups' and 'debug' for the library.
|
|
4
4
|
"""
|
|
5
5
|
# Apache-2.0 license
|
|
6
6
|
# Copyright (c) 2026 Asger Jon Vistisen
|
|
@@ -17,14 +17,15 @@ if TYPE_CHECKING: # pragma: no cover, no mutate
|
|
|
17
17
|
|
|
18
18
|
class TestSpace(BaseSpace):
|
|
19
19
|
"""
|
|
20
|
-
A test base built by 'TestMeta' has chosen that
|
|
21
|
-
not
|
|
22
|
-
'BaseTest' reports the failed 'subTest' blocks of a test,
|
|
23
|
-
place to say so is the line of
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'TestMeta' bind the two names
|
|
27
|
-
every binding of either by
|
|
20
|
+
A test base built by 'TestMeta' has chosen that the bodies of its
|
|
21
|
+
test classes do not bind 'doCleanups' or 'debug', two of the places
|
|
22
|
+
from which 'BaseTest' reports the failed 'subTest' blocks of a test,
|
|
23
|
+
each test method being the third. The place to say so is the line of
|
|
24
|
+
the class body that tries: the builder is then shown that line, not
|
|
25
|
+
the end of a class statement. TestSpace is the namespace 'TestMeta'
|
|
26
|
+
prepares for a test class. It lets 'TestMeta' bind the two names
|
|
27
|
+
before the class body runs and refuses every binding of either by
|
|
28
|
+
the class body.
|
|
28
29
|
|
|
29
30
|
class StrictTest(BaseTest, metaclass=TestMeta):
|
|
30
31
|
pass
|
|
@@ -3,8 +3,8 @@ The 'worktoy.work_test.samplers' package provides random sample-data
|
|
|
3
3
|
generators for the test suite. 'BaseSampler' defines the shared shape, a
|
|
4
4
|
value type plus a single-sample recipe sized into items, rows, and
|
|
5
5
|
tables, with a generator and a seed of its own; each concrete sampler
|
|
6
|
-
fills in one data type. 'SamplerMeta' builds them, so a sampler
|
|
7
|
-
|
|
6
|
+
fills in one data type. 'SamplerMeta' builds them, so a sampler class
|
|
7
|
+
that leaves either hook out cannot be instantiated.
|
|
8
8
|
|
|
9
9
|
- LOREM_WORDS, randomWord, loremSentence
|
|
10
10
|
- SamplerMeta
|