This `assert` statement needs to be in the outer block, not in the `with pytest.raises() as exc:` block.  The reason is that the `t = Time()` statement raises the exception and the `assert` statement never gets executed.  If it did, then you would see a failure (see next comment).