Mercurial > p > roundup > code
changeset 7670:a28ea83ace86
issue2551296 - from mock import Mock?
Fix mock import for newer python3 to use unittest.mock rather than
mock.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 24 Oct 2023 09:23:16 -0400 |
| parents | fa5c3c86bcf2 |
| children | 2fc2b14edbf7 |
| files | CHANGES.txt test/test_hyperdbvals.py |
| diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Thu Oct 19 17:30:22 2023 -0400 +++ b/CHANGES.txt Tue Oct 24 09:23:16 2023 -0400 @@ -62,6 +62,9 @@ - Handle out of memory error when importing large trackers in PostgreSQL. (Found by Norbert Schlemmer, extensive testing by Norbert, fix John Rouillard) +- use unittest.mock rather than mock for + test/test_hyperdbvals.py. (found by Ralf Schlatterbeck. Fix John + Rouillard) Features:
--- a/test/test_hyperdbvals.py Thu Oct 19 17:30:22 2023 -0400 +++ b/test/test_hyperdbvals.py Tue Oct 24 09:23:16 2023 -0400 @@ -10,7 +10,11 @@ import unittest, os, shutil, errno, sys, difflib, re from hashlib import sha1 -from mock import Mock +try: + from unittest.mock import Mock +except ImportError: + # python 2.7 + from mock import Mock from roundup import init, instance, password, hyperdb, date
