Extensibility

Ensure that the distributed package supports user extensions.

mypyc compilation can inadvertently seal classes, preventing inheritance. This module verifies that reprospect extension points (e.g., reprospect.test.sass.instruction.InstructionMatcher) remain subclassable after compilation, allowing users to extend reprospect capabilities.

class tests.test_extensibility.CannotBeExtendedView on GitHub

Bases: Fp32AddMatcher

reprospect.test.sass.instruction.Fp32AddMatcher was not marked as extensible.

pattern: Final[Pattern[str]]
class tests.test_extensibility.NewInstructionMatcherView on GitHub

Bases: InstructionMatcher

Faking a matcher for some unforeseen use case.

match(inst: str | Instruction) InstructionMatch | NoneView on GitHub
class tests.test_extensibility.NewPatternMatcherView on GitHub

Bases: PatternMatcher

Faking a matcher for some unforeseen use case.

__init__()View on GitHub
pattern: Final[Pattern[str]]
class tests.test_extensibility.TestCannotBeExtendedView on GitHub

Bases: object

test() NoneView on GitHub
class tests.test_extensibility.TestInspectView on GitHub

Bases: object

Use inspect to retrieve the provenance of objects.

test_Instruction() NoneView on GitHub
test_InstructionMatcher() NoneView on GitHub
class tests.test_extensibility.TestInstructionMatchingView on GitHub

Bases: object

Match instructions with NewInstructionMatcher and NewPatternMatcher.

CONTROLCODE: Final[ControlCode] = ControlCode(stall_count=5, yield_flag=False, read=7, write=7, wait=[True, False, False, False, False, False], reuse={'A': False, 'B': False, 'C': False, 'D': False})
DADD: Final[Instruction] = Instruction(offset=0, instruction='DADD R4, R4, c[0x0][0x180]', hex='0x0', control=ControlCode(stall_count=5, yield_flag=False, read=7, write=7, wait=[True, False, False, False, False, False], reuse={'A': False, 'B': False, 'C': False, 'D': False}))
DMUL: Final[Instruction] = Instruction(offset=0, instruction='DMUL R6, R6, c[0x0][0x188]', hex='0x1', control=ControlCode(stall_count=5, yield_flag=False, read=7, write=7, wait=[True, False, False, False, False, False], reuse={'A': False, 'B': False, 'C': False, 'D': False}))
NOP: Final[Instruction] = Instruction(offset=0, instruction='NOP', hex='0x2', control=ControlCode(stall_count=5, yield_flag=False, read=7, write=7, wait=[True, False, False, False, False, False], reuse={'A': False, 'B': False, 'C': False, 'D': False}))
test_NewInstructionMatcher() NoneView on GitHub
test_NewPatternMatcher() NoneView on GitHub