Skip to content

Commit 1ea5579

Browse files
committed
issue2551296 - from mock import Mock?
Fix mock import for newer python3 to use unittest.mock rather than mock.
1 parent 435985a commit 1ea5579

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ Fixed:
6262
- Handle out of memory error when importing large trackers in
6363
PostgreSQL. (Found by Norbert Schlemmer, extensive testing by
6464
Norbert, fix John Rouillard)
65+
- use unittest.mock rather than mock for
66+
test/test_hyperdbvals.py. (found by Ralf Schlatterbeck. Fix John
67+
Rouillard)
6568

6669
Features:
6770

test/test_hyperdbvals.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111
import unittest, os, shutil, errno, sys, difflib, re
1212
from hashlib import sha1
13-
from mock import Mock
13+
try:
14+
from unittest.mock import Mock
15+
except ImportError:
16+
# python 2.7
17+
from mock import Mock
1418

1519
from roundup import init, instance, password, hyperdb, date
1620

0 commit comments

Comments
 (0)