Merge pull request #236 from Peque/ci

Use pytest to run the test suite
This commit is contained in:
Adam Urbańczyk
2019-12-13 19:09:22 +01:00
committed by GitHub
15 changed files with 20 additions and 38 deletions

View File

@ -51,10 +51,9 @@ before_install:
- hash -r; - hash -r;
- conda config --set always_yes yes --set changeps1 no; - 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 - 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; - source ~/miniconda/bin/activate test_cq;
- pip install .[dev]
- python -c 'import OCC.gp as gp; print(gp.gp_Vec())' - python -c 'import OCC.gp as gp; print(gp.gp_Vec())'
- pip install codecov
install: install:
- python setup.py install - python setup.py install
@ -64,7 +63,7 @@ before_script:
- sudo rm -f /cores/core.* - sudo rm -f /cores/core.*
script: script:
- coverage run runtests.py - pytest -v --cov
after_success: after_success:
- codecov - codecov

View File

@ -19,13 +19,13 @@ install:
- conda update -q conda - 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 - 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 - activate cqtest
- pip install codecov - pip install .[dev]
- python setup.py install - python setup.py install
build: false build: false
test_script: test_script:
- coverage run runtests.py - pytest -v --cov
on_success: on_success:
- codecov - codecov

View File

@ -6,9 +6,6 @@ dependencies:
- python=3.6 - python=3.6
- pythonocc-core=0.18.2 - pythonocc-core=0.18.2
- oce=0.18.2 - oce=0.18.2
- pyparsing - pip
- pip: - pip:
- "--editable=." - "--editable=.[dev]"
# Documentation
- sphinx
- sphinx_rtd_theme

View File

@ -1,3 +0,0 @@
sphinx-rtd-theme==0.1.9
travis-sphinx==1.1.0
Sphinx==1.3.1

View File

View File

@ -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())

View File

@ -32,6 +32,17 @@ setup(
long_description=open('README.md').read(), long_description=open('README.md').read(),
packages=['cadquery','cadquery.contrib','cadquery.occ_impl','cadquery.plugins','tests'], packages=['cadquery','cadquery.contrib','cadquery.occ_impl','cadquery.plugins','tests'],
install_requires=['pyparsing'], install_requires=['pyparsing'],
extras_require={
'dev': [
# Documentation
'sphinx',
'sphinx_rtd_theme',
# Testing
'codecov',
'pytest',
'pytest-cov',
],
},
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
platforms='any', platforms='any',