dirty-equals
dirty-equals copied to clipboard
Idea: generate is now for IsNow only at moment when comparing
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
Can do, makes repr slightly more annoying.
Surely they're mostly very close to the same time.
Sorry for the noise, I accidentally pressed "enter" when I started typing the title of the issue
Makes sense, PR welcome to fix this.