Skip to content

Commit

Permalink
avoid util module tests from being run more than once in each call to…
Browse files Browse the repository at this point in the history
… bitarray.test() when called multiple times
  • Loading branch information
ilanschnell committed Feb 19, 2023
1 parent 112781e commit 6e52e49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGE_LOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* simplify count functionality in util module
* retire `bitcount_lookup[256]` table
* improve `util.count_n()` error messages
* avoid `util` module tests from being run more than once in each
call to `bitarray.test()` when called multiple times
* improve testing


Expand Down
7 changes: 4 additions & 3 deletions bitarray/test_bitarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -4669,8 +4669,9 @@ def test_pickle(self):
# ---------------------------------------------------------------------------

def run(verbosity=1, repeat=1):
import bitarray.test_util as btu
tests.extend(btu.tests)
import bitarray.test_util
all_tests = list(tests)
all_tests.extend(bitarray.test_util.tests)

default_endian = get_default_endian()
print('bitarray is installed in: %s' % os.path.dirname(__file__))
Expand All @@ -4684,7 +4685,7 @@ def run(verbosity=1, repeat=1):
print('PY_LITTLE_ENDIAN (use word shift): %s' % SYSINFO[7])
print('DEBUG: %s' % DEBUG)
suite = unittest.TestSuite()
for cls in tests:
for cls in all_tests:
for _ in range(repeat):
suite.addTest(unittest.makeSuite(cls))

Expand Down

0 comments on commit 6e52e49

Please sign in to comment.