From 816245f103cd43226ee9c4f36eaaf8d8c6a83c90 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Mon, 14 Nov 2022 08:25:01 +0100 Subject: [PATCH] Add sleep to ensure later timestamps --- spacy/tests/test_cli.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spacy/tests/test_cli.py b/spacy/tests/test_cli.py index 5d24a0047..4a49fa996 100644 --- a/spacy/tests/test_cli.py +++ b/spacy/tests/test_cli.py @@ -3,6 +3,7 @@ import math import pkg_resources from random import sample from typing import Counter +import time import pytest import srsly @@ -864,7 +865,11 @@ def test_local_remote_storage(): with make_tempdir() as d: filename = "a.txt" - for content_hash in ("aaaa", "bbbb", "cccc"): + content_hashes = ("aaaa", "cccc", "bbbb") + for i, content_hash in enumerate(content_hashes): + # make sure that each subsequent file has a later timestamp + if i > 0: + time.sleep(1) content = f"{content_hash} content" loc_file = d / "root" / filename if not loc_file.parent.exists():