File: 0002-De-flake-test_reload_works.patch

package info (click to toggle)
ledgerhelpers 0.3.10-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 616 kB
  • sloc: python: 3,783; makefile: 18
file content (29 lines) | stat: -rw-r--r-- 988 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Marcin Owsiany <porridge@debian.org>
Date: Wed, 9 Jul 2025 09:39:17 +0200
Subject: De-flake test_reload_works.

Closes: Bug#1108809
---
 tests/test_ledgerhelpers.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/test_ledgerhelpers.py b/tests/test_ledgerhelpers.py
index 4456db2..474b379 100644
--- a/tests/test_ledgerhelpers.py
+++ b/tests/test_ledgerhelpers.py
@@ -7,6 +7,7 @@ except ImportError:
     journal = None
 import tests.test_base as base
 import tempfile
+import time
 import unittest
 from unittest import TestCase as T
 
@@ -34,6 +35,7 @@ class TestJournal(T):
             _, commos = j.accounts_and_last_commodity_for_account()
             self.assertEqual(commos["Expenses:Drinking"], "1.00 CHF")
             data = data.replace("CHF", "EUR")
+            time.sleep(0.01) # Wait a few ms to make sure st_mtime of the file changes
             f.write(data)
             f.flush()
             _, commos = j.accounts_and_last_commodity_for_account()