dirty-equals icon indicating copy to clipboard operation
dirty-equals copied to clipboard

Idea: generate is now for IsNow only at moment when comparing

Open hyzyla opened this issue 3 years ago • 3 comments

My use case is pytest with parametrize method. In such situation, IsNow() will compare time generated when pytest will collect tests and now time when tests were run.

@pytest.mark.parametrize(
    "params, expected",
    [
        (
           {'some_key': 'some_value'},
           IsNow(),
        ),
        ...,
    ],
)
def test_handler(
    client,
    params
    expected,
):
    response = make_request(params)
    response['time'] = expected

hyzyla avatar May 09 '22 13:05 hyzyla

Can do, makes repr slightly more annoying.

Surely they're mostly very close to the same time.

samuelcolvin avatar May 09 '22 14:05 samuelcolvin

Sorry for the noise, I accidentally pressed "enter" when I started typing the title of the issue

hyzyla avatar May 09 '22 14:05 hyzyla

Makes sense, PR welcome to fix this.

samuelcolvin avatar May 09 '22 14:05 samuelcolvin