Skip to content

Commit

Permalink
Updated unit testing to work from many entrypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerkin committed Feb 6, 2018
1 parent c033868 commit ab4602d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
7 changes: 1 addition & 6 deletions sciunit/unit_test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""All unit tests for SciUnit"""
"""Unit testing module for sciunit"""

import unittest
import sys
Expand All @@ -25,9 +25,4 @@ def test_import_everything(self):

# Recursively import all submodules
import_all_modules(sciunit)


if __name__ == '__main__':
buffer = 'buffer' in sys.argv
sys.argv = sys.argv[:1] # Args need to be removed for __main__ to work.
unittest.main(buffer=buffer)
15 changes: 15 additions & 0 deletions sciunit/unit_test/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""All unit tests for SciUnit"""

import sys
import unittest
from . import *

def main():
buffer = 'buffer' in sys.argv
sys.argv = sys.argv[:1] # Args need to be removed for __main__ to work.
unittest.main(buffer=buffer)

if __name__ == '__main__':
main()


4 changes: 2 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pip install coveralls
git clone -b cosmosuite http://github.com/scidash/scidash ../scidash
UNIT_TEST_SUITE="sciunit/unit_test/core_tests.py buffer"
UNIT_TEST_SUITE="sciunit.unit_test buffer"
# Fundamental Python bug prevents this latter method from allowing
# some notebook tests to pass.
#UNIT_TEST_SUITE="setup.py test"
coverage run --source=. --omit=*unit_test*,setup.py,.eggs $UNIT_TEST_SUITE
coverage run -m --source=. --omit=*unit_test*,setup.py,.eggs $UNIT_TEST_SUITE

0 comments on commit ab4602d

Please sign in to comment.