[PR #1385] Review/1365 property test discovery #1417

Open
opened 2026-11-26 20:21:11 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1385
Author: @xel1uz
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: review/1365-property-test-discovery


📝 Commits (2)

  • fd0a539 tests: the CI registration scan counts the tests a TestCase inherits from a class of its module (TEST-CI-REG-LOCAL-MIXIN)
  • a127418 Exclude property-only mixins from unittest registration counts

📊 Changes

1 file changed (+80 additions, -5 deletions)

View changed files

📝 tests/test_ci_registration.py (+80 -5)

📄 Description

Claimed in the coordination issue as: TEST-CI-REG-LOCAL-MIXIN (original claim by @milk4sale).

Depends on: #1365. This branch includes @milk4sale's support for test methods inherited from a mixin in the same module.

What and why

On #1365, a TestCase that inherits only @property def test_label(self) can pass the CI registration check even though unittest discovers zero tests. The scanner sees the test prefix on the function definition, but looking up the name on the class returns a property.

The follow-up teaches the scanner to recognize @property and its getter, setter, and deleter forms. It adds two cases checked against real unittest discovery: an inherited property with a setter contributes zero tests, while an inherited @staticmethod def test_one() contributes one.

Tested

  • Reproduced the mismatch on the original PR at fd0a5390: the registration check accepted the property-only mixin, while unittest collected zero tests.
  • On a1274181, the scanner agreed with unittest in both new cases. Ran py -3.12 -I tests/test_ci_registration.py on Windows with Python 3.12.10: all 16 tests passed.
  • On the original PR, also ran py -3.12 -m unittest discover -s tests/semantic -p test_sub_co_same_operand.py -v: all six tests in the module that motivated #1365 passed.
  • git diff --check and scripts/check_no_game_data.py passed for the changed file.

GPUs tested: n/a (Python test discovery).

AI-assisted: yes, OpenAI Codex.

Checklist

  • Verified a clean merge against upstream main at 28a32e19.
  • One topic: make CI registration agree with unittest discovery for local mixins.
  • No game data, keys or decryption.
  • Translator contract table: n/a. No translator rule changed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1385 **Author:** [@xel1uz](https://github.com/xel1uz) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `review/1365-property-test-discovery` --- ### 📝 Commits (2) - [`fd0a539`](https://github.com/ubiquitarianism/leonida/commit/fd0a5390753c24c92428b6beadd41b704a93cbb1) tests: the CI registration scan counts the tests a TestCase inherits from a class of its module (TEST-CI-REG-LOCAL-MIXIN) - [`a127418`](https://github.com/ubiquitarianism/leonida/commit/a1274181a827762c9f6b8911851f9786e6f88f4b) Exclude property-only mixins from unittest registration counts ### 📊 Changes **1 file changed** (+80 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_ci_registration.py` (+80 -5) </details> ### 📄 Description Claimed in the coordination issue as: [TEST-CI-REG-LOCAL-MIXIN](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7146307911) (original claim by @milk4sale). Depends on: #1365. This branch includes @milk4sale's support for test methods inherited from a mixin in the same module. ### What and why On #1365, a `TestCase` that inherits only `@property def test_label(self)` can pass the CI registration check even though `unittest` discovers zero tests. The scanner sees the `test` prefix on the function definition, but looking up the name on the class returns a property. The follow-up teaches the scanner to recognize `@property` and its getter, setter, and deleter forms. It adds two cases checked against real `unittest` discovery: an inherited property with a setter contributes zero tests, while an inherited `@staticmethod def test_one()` contributes one. ### Tested - Reproduced the mismatch on the original PR at `fd0a5390`: the registration check accepted the property-only mixin, while `unittest` collected zero tests. - On `a1274181`, the scanner agreed with `unittest` in both new cases. Ran `py -3.12 -I tests/test_ci_registration.py` on Windows with Python 3.12.10: all 16 tests passed. - On the original PR, also ran `py -3.12 -m unittest discover -s tests/semantic -p test_sub_co_same_operand.py -v`: all six tests in the module that motivated #1365 passed. - `git diff --check` and `scripts/check_no_game_data.py` passed for the changed file. GPUs tested: n/a (Python test discovery). AI-assisted: yes, OpenAI Codex. ### Checklist - [x] Verified a clean merge against upstream `main` at `28a32e19`. - [x] One topic: make CI registration agree with unittest discovery for local mixins. - [x] No game data, keys or decryption. - Translator contract table: n/a. No translator rule changed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1417
No description provided.