Skip to content

Commit

Permalink
Tests: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
astaric committed Jun 1, 2016
1 parent 7d4db35 commit 1db0f86
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
22 changes: 22 additions & 0 deletions orangecontrib/example/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
import unittest

def suite(loader=None, pattern='test*.py'):
test_dir = os.path.dirname(__file__)
if loader is None:
loader = unittest.TestLoader()
if pattern is None:
pattern = 'test*.py'
all_tests = [
loader.discover(test_dir, pattern),
]

return unittest.TestSuite(all_tests)


def load_tests(loader, tests, pattern):
return suite(loader, pattern)


if __name__ == '__main__':
unittest.main(defaultTest='suite')
6 changes: 6 additions & 0 deletions orangecontrib/example/tests/test_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import unittest


class ExampleTests(unittest.TestCase):
def test_addition(self):
self.assertEqual(1 + 1, 2)
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

NAMESPACE_PACKAGES = ["orangecontrib"]

TEST_SUITE = "orangecontrib.example.tests.suite"

if __name__ == '__main__':
setup(
Expand All @@ -71,6 +72,7 @@
entry_points=ENTRY_POINTS,
keywords=KEYWORDS,
namespace_packages=NAMESPACE_PACKAGES,
test_suite=TEST_SUITE,
include_package_data=True,
zip_safe=False,
)

0 comments on commit 1db0f86

Please sign in to comment.