<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> the one quirk I've found so far with writing tests is that I can't compare a state to an enum member directly, I have to specify Enum.MEMBER.value, e.g.</p><p>...<br />from amaranth.lib import enum, wiring<br />...<br />class RunState(enum.Enum):<br /> NONE = 0<br /> STOP = 1<br /> LATCH = 2<br /> DATA = 3<br /> ONESHOT = 4<br /> CONTINUOUS = 5<br />...</p><p>async def testbench(ctx):<br /> # set initial state<br /> ctx.set(dut.reg_run_state, RunState.NONE)<br />...</p><p> assert ctx.get(dut.reg_run_state) == RunState.NONE.value # assertion ok<br /> assert ctx.get(dut.reg_run_state) == RunState.NONE # assertion fails</p><p>I'm guessing this is a Python quirk, so a note in the testing docs about it would be very helpful!</p>