summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-08-05 08:45:33 +0200
committerMichał Górny <mgorny@gentoo.org>2021-08-05 09:29:06 +0200
commit43721251f27a53bd680dd43ed8e08745f7fa1d05 (patch)
tree3121dc9b8c0c8c8f68783c2e40c5ca1bb56e4452 /dev-python/parso
parentdev-python/signature_dispatch: Bump to 0.2.0 (diff)
downloadgentoo-43721251f27a53bd680dd43ed8e08745f7fa1d05.tar.gz
gentoo-43721251f27a53bd680dd43ed8e08745f7fa1d05.tar.bz2
gentoo-43721251f27a53bd680dd43ed8e08745f7fa1d05.zip
dev-python/parso: Backport flaky test fix
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/parso')
-rw-r--r--dev-python/parso/files/parso-0.8.2-flaky-test.patch23
-rw-r--r--dev-python/parso/parso-0.8.2.ebuild1
2 files changed, 24 insertions, 0 deletions
diff --git a/dev-python/parso/files/parso-0.8.2-flaky-test.patch b/dev-python/parso/files/parso-0.8.2-flaky-test.patch
new file mode 100644
index 000000000000..729ec409c829
--- /dev/null
+++ b/dev-python/parso/files/parso-0.8.2-flaky-test.patch
@@ -0,0 +1,23 @@
+From 60fed7b9f80cbb3d9cb7a9e42ad8c0f3c513801d Mon Sep 17 00:00:00 2001
+From: Saiyang Gou <gousaiyang@163.com>
+Date: Sat, 29 May 2021 18:17:24 -0700
+Subject: [PATCH] Fix flaky test_cache_last_used_update again (#189)
+
+This is a follow up for #177. On Windows, `assert node_cache_item.last_used < now` may fail as the two time values can be equal.
+---
+ test/test_cache.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/test_cache.py b/test/test_cache.py
+index f4291c2..5e633fc 100644
+--- a/test/test_cache.py
++++ b/test/test_cache.py
+@@ -137,7 +137,7 @@ def test_cache_last_used_update(diff_cache, use_file_io):
+ parse('somecode', cache=True, path=p)
+ node_cache_item = next(iter(parser_cache.values()))[p]
+ now = time.time()
+- assert node_cache_item.last_used < now
++ assert node_cache_item.last_used <= now
+
+ if use_file_io:
+ f = _FixedTimeFileIO(p, 'code', node_cache_item.last_used - 10)
diff --git a/dev-python/parso/parso-0.8.2.ebuild b/dev-python/parso/parso-0.8.2.ebuild
index 37196d2c7c28..2637f5cf5c31 100644
--- a/dev-python/parso/parso-0.8.2.ebuild
+++ b/dev-python/parso/parso-0.8.2.ebuild
@@ -20,6 +20,7 @@ distutils_enable_tests pytest
PATCHES=(
"${FILESDIR}"/${P}-py310.patch
+ "${FILESDIR}"/${P}-flaky-test.patch
)
python_test() {