diff --git a/.travis.yml b/.travis.yml index c6a7ba097..2f9636648 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,26 +51,25 @@ before_install: - hash -r; - conda config --set always_yes yes --set changeps1 no; - conda create -y -q -n test_cq -c cadquery -c conda-forge pythonocc-core=0.18.2 oce=0.18.2 python=$TRAVIS_PYTHON_VERSION - pyparsing mock; - source ~/miniconda/bin/activate test_cq; +- pip install .[dev] - python -c 'import OCC.gp as gp; print(gp.gp_Vec())' -- pip install codecov install: - python setup.py install before_script: -- ulimit -c unlimited -S +- ulimit -c unlimited -S - sudo rm -f /cores/core.* script: -- coverage run runtests.py +- pytest -v --cov after_success: - codecov after_failure: -- ls /cores/core.* +- ls /cores/core.* - lldb --core `ls /cores/core.*` --batch --one-line "bt" diff --git a/appveyor.yml b/appveyor.yml index 0f62ef517..6715e5b60 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,14 +19,14 @@ install: - conda update -q conda - conda create --quiet --name cqtest -c cadquery -c conda-forge -c dlr-sc pythonocc-core=0.18.2 python=%PYTHON_VERSION% pyparsing mock coverage codecov - activate cqtest - - pip install codecov + - pip install .[dev] - python setup.py install build: false test_script: - - coverage run runtests.py - + - pytest -v --cov + on_success: - codecov diff --git a/environment.yml b/environment.yml index dfc98e171..924a49720 100644 --- a/environment.yml +++ b/environment.yml @@ -6,9 +6,6 @@ dependencies: - python=3.6 - pythonocc-core=0.18.2 - oce=0.18.2 - - pyparsing + - pip - pip: - - "--editable=." - # Documentation - - sphinx - - sphinx_rtd_theme + - "--editable=.[dev]" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 872a66d23..000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,3 +0,0 @@ -sphinx-rtd-theme==0.1.9 -travis-sphinx==1.1.0 -Sphinx==1.3.1 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/runtests.py b/runtests.py deleted file mode 100644 index f1052ca93..000000000 --- a/runtests.py +++ /dev/null @@ -1,22 +0,0 @@ -import sys -from tests import * -import cadquery -import unittest - -#if you are on python 2.7, you can use -m uniitest discover. -#but this is required for python 2.6.6 on windows. FreeCAD0.12 will not load -#on py 2.7.x on win -suite = unittest.TestSuite() - -suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestCadObjects.TestCadObjects)) -suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestCadQuery.TestCadQuery)) -suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestCQGI.TestCQGI)) -suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestCQSelectors.TestCQSelectors)) -suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestExporters.TestExporters)) -suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestImporters.TestImporters)) -suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestJupyter.TestJupyter)) -suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestWorkplanes.TestWorkplanes)) - -if __name__ == '__main__': - result = unittest.TextTestRunner().run(suite) - sys.exit(not result.wasSuccessful()) diff --git a/setup.py b/setup.py index 24d2a8e19..a2873e339 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,17 @@ long_description=open('README.md').read(), packages=['cadquery','cadquery.contrib','cadquery.occ_impl','cadquery.plugins','tests'], install_requires=['pyparsing'], + extras_require={ + 'dev': [ + # Documentation + 'sphinx', + 'sphinx_rtd_theme', + # Testing + 'codecov', + 'pytest', + 'pytest-cov', + ], + }, include_package_data=True, zip_safe=False, platforms='any', diff --git a/tests/TestCadObjects.py b/tests/test_cad_objects.py similarity index 100% rename from tests/TestCadObjects.py rename to tests/test_cad_objects.py diff --git a/tests/TestCadQuery.py b/tests/test_cadquery.py similarity index 100% rename from tests/TestCadQuery.py rename to tests/test_cadquery.py diff --git a/tests/TestCQGI.py b/tests/test_cqgi.py similarity index 100% rename from tests/TestCQGI.py rename to tests/test_cqgi.py diff --git a/tests/TestExporters.py b/tests/test_exporters.py similarity index 100% rename from tests/TestExporters.py rename to tests/test_exporters.py diff --git a/tests/TestImporters.py b/tests/test_importers.py similarity index 100% rename from tests/TestImporters.py rename to tests/test_importers.py diff --git a/tests/TestJupyter.py b/tests/test_jupyter.py similarity index 100% rename from tests/TestJupyter.py rename to tests/test_jupyter.py diff --git a/tests/TestCQSelectors.py b/tests/test_selectors.py similarity index 100% rename from tests/TestCQSelectors.py rename to tests/test_selectors.py diff --git a/tests/TestWorkplanes.py b/tests/test_workplanes.py similarity index 100% rename from tests/TestWorkplanes.py rename to tests/test_workplanes.py