Skip to content

Commit

Permalink
allow running python setup.py test
Browse files Browse the repository at this point in the history
  • Loading branch information
ilanschnell committed Feb 20, 2023
1 parent c991d40 commit 9fdee1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bitarray/_bitarray.so: bitarray/_bitarray.c


test: bitarray/_bitarray.so
$(PYTHON) -c "import bitarray; bitarray.test()"
$(PYTHON) setup.py test


install:
Expand Down
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import re
import sys

if "test" in sys.argv:
import bitarray
# when test was successful, return 0 (hence not)
sys.exit(not bitarray.test().wasSuccessful())

try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension

if "test" in sys.argv:
exit('ERROR: To run the bitarray test suite, type:\n\n'
' python -c "import bitarray; bitarray.test()"\n')

kwds = {}
try:
Expand Down

0 comments on commit 9fdee1a

Please sign in to comment.