Skip to content
Permalink
Browse files

MNT: Make module backtesting.test runnable

  • Loading branch information...
kernc committed Jan 8, 2019
1 parent c1cdc9e commit fdc1185b79cd9d40afb6f1304fe4a215533a89ab
Showing with 11 additions and 8 deletions.
  1. +6 −0 backtesting/test/__main__.py
  2. +4 −0 backtesting/test/_test.py
  3. +1 −8 setup.py
@@ -0,0 +1,6 @@
import unittest

suite = unittest.defaultTestLoader.discover('backtesting.test',
pattern='_test*.py')
if __name__ == '__main__':
unittest.TextTestRunner().run(suite)
@@ -500,6 +500,10 @@ class Class:
self.assertEqual(_as_str(_Array([1], name=s)), s[0])


@unittest.skipUnless(
os.path.isdir(os.path.join(os.path.dirname(__file__),
'..', '..', 'doc')),
"docs dir doesn't exist")
class TestDocs(TestCase):
def test_examples(self):
examples = glob(os.path.join(os.path.dirname(__file__),
@@ -5,13 +5,6 @@
sys.exit('ERROR: Backtesting.py requires Python 3.4+')


def _discover_tests():
import unittest
return unittest.defaultTestLoader.discover('backtesting.test',
pattern='*test*.py',
top_level_dir='.')


if __name__ == '__main__':
from setuptools import setup, find_packages

@@ -52,7 +45,7 @@ def _discover_tests():
'flake8',
],
},
test_suite="setup._discover_tests",
test_suite="backtesting.test",
python_requires='>=3.4',
author='Zach Lûster',
classifiers=[

0 comments on commit fdc1185

Please sign in to comment.
You can’t perform that action at this time.