worktoy 1.2.1.dev0__tar.gz → 1.2.1.dev1__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.
Files changed (207) hide show
  1. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/PKG-INFO +2 -2
  2. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/README.md +1 -1
  3. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/pyproject.toml +1 -1
  4. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/__init__.py +1 -1
  5. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/_base_test.py +118 -63
  6. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/_complex_mixin.py +41 -6
  7. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/_complex_test.py +1 -1
  8. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/_sub_test.py +24 -8
  9. worktoy-1.2.1.dev1/src/worktoy/work_test/_test_meta.py +139 -0
  10. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/_test_space.py +11 -10
  11. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/__init__.py +2 -2
  12. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/_base_sampler.py +184 -60
  13. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/_int_sampler.py +47 -7
  14. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/_lorem_text.py +90 -17
  15. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/_sampler_meta.py +8 -6
  16. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/_symbolic_sampler.py +4 -5
  17. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy.egg-info/PKG-INFO +2 -2
  18. worktoy-1.2.1.dev0/src/worktoy/work_test/_test_meta.py +0 -123
  19. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/LICENSE +0 -0
  20. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/setup.cfg +0 -0
  21. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/__init__.py +0 -0
  22. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/_instance_owner.py +0 -0
  23. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/_meta_type.py +0 -0
  24. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/_object.py +0 -0
  25. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/control_flow/__init__.py +0 -0
  26. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/control_flow/_control_flow.py +0 -0
  27. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/control_flow/_control_space.py +0 -0
  28. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/control_flow/_meta_flow.py +0 -0
  29. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/control_flow/_skip_set.py +0 -0
  30. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/sentinels/__init__.py +0 -0
  31. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/sentinels/_args.py +0 -0
  32. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/sentinels/_deleted.py +0 -0
  33. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/sentinels/_desc.py +0 -0
  34. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/sentinels/_meta_call.py +0 -0
  35. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/sentinels/_owner.py +0 -0
  36. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/sentinels/_sentinel.py +0 -0
  37. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/core/sentinels/_this.py +0 -0
  38. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/desc/__init__.py +0 -0
  39. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/desc/_alias.py +0 -0
  40. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/desc/_attri_box.py +0 -0
  41. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/desc/_base_descriptor.py +0 -0
  42. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/desc/_fast_box.py +0 -0
  43. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/desc/_field.py +0 -0
  44. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/desc/_fix_box.py +0 -0
  45. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/desc/_root_alias.py +0 -0
  46. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/desc/_symbolic_name.py +0 -0
  47. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/dispatch/__init__.py +0 -0
  48. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/dispatch/_call_me_maybe.py +0 -0
  49. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/dispatch/_dispatcher.py +0 -0
  50. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/dispatch/_flex_call.py +0 -0
  51. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/dispatch/_overload.py +0 -0
  52. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/dispatch/_permuter.py +0 -0
  53. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/dispatch/_permuter_method.py +0 -0
  54. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/dispatch/_type_sig.py +0 -0
  55. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/ezdata/__init__.py +0 -0
  56. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/ezdata/_ez_data.py +0 -0
  57. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/ezdata/_ez_field.py +0 -0
  58. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/ezdata/_ez_hook.py +0 -0
  59. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/ezdata/_ez_meta.py +0 -0
  60. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/ezdata/_ez_space.py +0 -0
  61. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/ezdata/_ez_store.py +0 -0
  62. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/ezdata/_fields.py +0 -0
  63. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/__init__.py +0 -0
  64. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_access_num.py +0 -0
  65. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_box.py +0 -0
  66. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_flag.py +0 -0
  67. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_flags.py +0 -0
  68. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_flags_hook.py +0 -0
  69. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_flags_meta.py +0 -0
  70. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_flags_space.py +0 -0
  71. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_member.py +0 -0
  72. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_meta.py +0 -0
  73. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_meta_meta.py +0 -0
  74. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_num.py +0 -0
  75. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_space.py +0 -0
  76. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/keenum/_kee_space_hook.py +0 -0
  77. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/lorem_ipsum/__init__.py +0 -0
  78. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/lorem_ipsum/_base_generator.py +0 -0
  79. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/lorem_ipsum/_clause.py +0 -0
  80. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/lorem_ipsum/_gaussian_lengths.py +0 -0
  81. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/lorem_ipsum/_paragraph.py +0 -0
  82. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/lorem_ipsum/_sentence.py +0 -0
  83. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/lorem_ipsum/_stochastic_variable.py +0 -0
  84. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/lorem_ipsum/_stochastic_word.py +0 -0
  85. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/lorem_ipsum/_words.py +0 -0
  86. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/__init__.py +0 -0
  87. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/_abstract_metaclass.py +0 -0
  88. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/_abstract_namespace.py +0 -0
  89. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/_base_meta.py +0 -0
  90. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/_base_object.py +0 -0
  91. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/_base_space.py +0 -0
  92. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/space_hooks/__init__.py +0 -0
  93. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/space_hooks/_abstract_space_hook.py +0 -0
  94. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/space_hooks/_flex_call_hook.py +0 -0
  95. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/space_hooks/_load_space_hook.py +0 -0
  96. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/space_hooks/_name_hook.py +0 -0
  97. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/space_hooks/_reserved_names.py +0 -0
  98. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/space_hooks/_reserved_namespace_hook.py +0 -0
  99. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/mcls/space_hooks/_space_desc.py +0 -0
  100. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/py.typed +0 -0
  101. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/__init__.py +0 -0
  102. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_args_count.py +0 -0
  103. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_bipartite_matching.py +0 -0
  104. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_class_body_template.py +0 -0
  105. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_directory.py +0 -0
  106. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_exception_info.py +0 -0
  107. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_join_words.py +0 -0
  108. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_maybe.py +0 -0
  109. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_quick_desc.py +0 -0
  110. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_replace_flex.py +0 -0
  111. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_resolve_mro.py +0 -0
  112. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_slice_len.py +0 -0
  113. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_string_list.py +0 -0
  114. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_text_fmt.py +0 -0
  115. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_type_cast.py +0 -0
  116. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_unpack.py +0 -0
  117. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_valid_slice.py +0 -0
  118. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/_word_wrap.py +0 -0
  119. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/combinatorics/__init__.py +0 -0
  120. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/combinatorics/_arrangement.py +0 -0
  121. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/combinatorics/_arrangements.py +0 -0
  122. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/utilities/combinatorics/_index_permutations.py +0 -0
  123. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/__init__.py +0 -0
  124. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_alternative_warning.py +0 -0
  125. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_deprecated_promise.py +0 -0
  126. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_missing_variable.py +0 -0
  127. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_redundant_keyword.py +0 -0
  128. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_risk_warning.py +0 -0
  129. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_subclass_exception.py +0 -0
  130. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_type_exception.py +0 -0
  131. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_uncheckable_type.py +0 -0
  132. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_unpack_exception.py +0 -0
  133. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_variable_not_none.py +0 -0
  134. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_work_toy_exception.py +0 -0
  135. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/_work_toy_warning.py +0 -0
  136. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/control_flow/__init__.py +0 -0
  137. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/__init__.py +0 -0
  138. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_access_error.py +0 -0
  139. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_dangling_alias.py +0 -0
  140. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_descriptor_exception.py +0 -0
  141. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_missing_instance_dict.py +0 -0
  142. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_nameless_callback.py +0 -0
  143. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_not_a_descriptor.py +0 -0
  144. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_overload_reference.py +0 -0
  145. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_phantom_box_error.py +0 -0
  146. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_protected_error.py +0 -0
  147. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_read_only_error.py +0 -0
  148. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_recursive_read.py +0 -0
  149. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_reference_conflict.py +0 -0
  150. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_shared_descriptor.py +0 -0
  151. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_without_exception.py +0 -0
  152. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/desc/_write_once_error.py +0 -0
  153. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/dispatch/__init__.py +0 -0
  154. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/dispatch/_bare_overload.py +0 -0
  155. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/dispatch/_dispatch_exception.py +0 -0
  156. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/dispatch/_duplicate_signature.py +0 -0
  157. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/dispatch/_type_cast_exception.py +0 -0
  158. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/dispatch/_unbound_cast_hook.py +0 -0
  159. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/__init__.py +0 -0
  160. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_class_field_error.py +0 -0
  161. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_duplicate_error.py +0 -0
  162. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_extra_keyword_exception.py +0 -0
  163. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_extra_positional_exception.py +0 -0
  164. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_incomplete_field_exception.py +0 -0
  165. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_kw_only_exception.py +0 -0
  166. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_repeated_field_exception.py +0 -0
  167. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_reserved_attribute_error.py +0 -0
  168. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_reserved_field_error.py +0 -0
  169. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/ezdata/_reserved_method_error.py +0 -0
  170. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/__init__.py +0 -0
  171. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_box_exception.py +0 -0
  172. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_box_type_error.py +0 -0
  173. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_box_value_error.py +0 -0
  174. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_case_exception.py +0 -0
  175. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_duplicate.py +0 -0
  176. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_flag_duplicate.py +0 -0
  177. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_flag_name_error.py +0 -0
  178. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_member_name_error.py +0 -0
  179. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_name_conflict.py +0 -0
  180. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_resolve_error.py +0 -0
  181. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_type_exception.py +0 -0
  182. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/keenum/_kee_write_once_error.py +0 -0
  183. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/__init__.py +0 -0
  184. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_claimed_name.py +0 -0
  185. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_control_class_error.py +0 -0
  186. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_del_exception.py +0 -0
  187. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_duplicate_hook.py +0 -0
  188. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_duplicate_sentinel.py +0 -0
  189. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_hook_exception.py +0 -0
  190. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_illegal_instantiation.py +0 -0
  191. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_mixed_method_kind.py +0 -0
  192. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_overload_conflict.py +0 -0
  193. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_questionable_syntax.py +0 -0
  194. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_rebound_overload.py +0 -0
  195. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_reserved_name.py +0 -0
  196. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_shadowed_class_hook.py +0 -0
  197. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_slots_refused.py +0 -0
  198. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/waitaminute/meta/_unbound_class_hook.py +0 -0
  199. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/__init__.py +0 -0
  200. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/_float_sampler.py +0 -0
  201. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/_gaussian_sampler.py +0 -0
  202. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/_lorem_sampler.py +0 -0
  203. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy/work_test/samplers/_word_sampler.py +0 -0
  204. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy.egg-info/SOURCES.txt +0 -0
  205. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy.egg-info/dependency_links.txt +0 -0
  206. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/src/worktoy.egg-info/top_level.txt +0 -0
  207. {worktoy-1.2.1.dev0 → worktoy-1.2.1.dev1}/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.dev0
3
+ Version: 1.2.1.dev1
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
  [![PyPI version](https://img.shields.io/pypi/v/worktoy)](https://pypi.org/project/worktoy/)
33
33
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
34
34
 
35
- # worktoy v1.2.1-dev0 (development build)
35
+ # worktoy v1.2.1-dev1 (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
  [![PyPI version](https://img.shields.io/pypi/v/worktoy)](https://pypi.org/project/worktoy/)
5
5
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
6
 
7
- # worktoy v1.2.1-dev0 (development build)
7
+ # worktoy v1.2.1-dev1 (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
@@ -5,7 +5,7 @@ build-backend = 'setuptools.build_meta'
5
5
 
6
6
  [project]
7
7
  name = "worktoy"
8
- version = "1.2.1-dev0"
8
+ version = "1.2.1-dev1"
9
9
  authors = [
10
10
  { name = "Asger Jon Vistisen", email = "asgerjon2@gmail.com" },
11
11
  ]
@@ -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-dev0'
51
+ __version__ = '1.2.1-dev1'
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
- 'SubTest' descriptor, which builds one accumulator per test instance;
205
- '_reportSubTests' reads it without building one and fails the test
206
- once, with 'FAIL [label]: message' or 'ERROR [label]: repr' per
207
- recorded block, each followed by the traceback of what the block
208
- raised. '__class_init__' gives every test class test methods that run
209
- it as they end, and a 'doCleanups' and a 'debug' that run it for what
210
- a 'tearDown' or a cleanup recorded, so a 'tearDown', a 'doCleanups',
211
- a 'debug' or a 'run' of a test class need not hand on for it.
212
- 'tearDownClass' unloads the module of the test class and runs the
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
- The 'argReport' method builds a string report of the given arguments,
271
- used in the test cases to provide informative error messages when a
272
- test fails. The report puts each argument on a line of its own as
273
- '<type: value>'. A line of 48 characters or more, a limit the 'chars'
274
- keyword replaces, is cut to three characters fewer and closed with an
275
- ellipsis; the 'newLine' keyword replaces the line separator.
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
- The 'seedSamplers' method seeds the six samplers of this test with
303
- one seed, so a test reruns with the same draws by calling it in its
304
- 'setUp'. A seed that is no 'int' is refused by the first sampler
305
- with 'TypeException' before any sampler is seeded.
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
- The '_formatRaised' method renders the traceback of a recorded
322
- exception as the interpreter would, so the report of a sub-test
323
- block names the line that raised.
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
- The '_reportSubTests' method peeks at any sub-test recorded on this
427
- instance through the 'subTest' descriptor and fails the test if that
428
- sub-test holds any fails or errors, naming each with its label and
429
- the traceback of what it raised. The records it reports are dropped
430
- from the instance first, so a second call reports nothing twice.
431
- Every test method a test class is given calls the method as it
432
- ends, the 'doCleanups' registers it as the last cleanup of the test,
433
- and the 'debug' calls it at its end; see '__class_init__'.
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
- The '_resolveOther' method coerces 'other' to an instance of 'cls',
144
- accepting another instance, a real number, a builtin complex, or any
145
- iterable or single value the constructor admits, and returning
146
- 'NotImplemented' when none of those work.
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
- The 'conjugate' method returns the complex conjugate as a new
176
- instance.
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 module importing it pays twenty-five skipped
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
- writes 'with self.subTest(target=x):' as it would with 'unittest'.
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
- __field_name__: Optional[str] = None # should be '_subTest'
70
- __field_owner__: Optional[Type[BaseTest]] = None # should be 'BaseTest'
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 '_addFail' method records a fail under the label of the block in
183
- progress, '<sub test>' outside any block.
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
- The '_addError' method records an error under the label of the block
191
- in progress, '<sub test>' outside any block.
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 body runs in. It keeps the names
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 its test classes do
21
- not replace 'doCleanups' or 'debug', the two places from which
22
- 'BaseTest' reports the failed 'subTest' blocks of a test, and the
23
- place to say so is the line of the class body that tries: the builder
24
- is then shown that line, not the end of a class statement. TestSpace
25
- is the namespace 'TestMeta' prepares for a test class. It lets
26
- 'TestMeta' bind the two names before the class body runs and refuses
27
- every binding of either by the class body.
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 without
7
- both hooks is refused.
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