File: 0002-beancount-scripts-doctor_test.py-Allow-pytest-import.patch

package info (click to toggle)
beancount 3.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,180 kB
  • sloc: python: 22,344; yacc: 753; ansic: 586; lex: 494; cpp: 44; makefile: 34
file content (24 lines) | stat: -rw-r--r-- 769 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
From: Boyuan Yang <byang@debian.org>
Date: Tue, 28 Jan 2025 10:42:25 -0500
Subject: beancount/scripts/doctor_test.py: Allow pytest import

---
 beancount/scripts/doctor_test.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/beancount/scripts/doctor_test.py b/beancount/scripts/doctor_test.py
index 9e7512b..53254c8 100644
--- a/beancount/scripts/doctor_test.py
+++ b/beancount/scripts/doctor_test.py
@@ -8,7 +8,10 @@ import unittest
 from os import path
 
 from beancount.parser import cmptest
-from beancount.scripts import directories_test
+try:
+    from beancount.scripts import directories_test
+except ImportError:
+    from . import directories_test
 from beancount.scripts.doctor import doctor
 from beancount.utils import test_utils