fix python tests and make verbose so they are easy to debug

release/4.3a0
Varun Agrawal 2021-08-28 15:37:06 -04:00
parent 2f6b8d6314
commit 286b2fa4b0
2 changed files with 7 additions and 4 deletions

View File

@ -166,5 +166,6 @@ add_custom_target(
COMMAND COMMAND
${CMAKE_COMMAND} -E env # add package to python path so no need to install ${CMAKE_COMMAND} -E env # add package to python path so no need to install
"PYTHONPATH=${GTSAM_PYTHON_BUILD_DIRECTORY}/$ENV{PYTHONPATH}" "PYTHONPATH=${GTSAM_PYTHON_BUILD_DIRECTORY}/$ENV{PYTHONPATH}"
${PYTHON_EXECUTABLE} -m unittest discover -s "${GTSAM_PYTHON_BUILD_DIRECTORY}/gtsam/tests" ${PYTHON_EXECUTABLE} -m unittest discover -v -s .
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES}) DEPENDS ${GTSAM_PYTHON_DEPENDENCIES}
WORKING_DIRECTORY "${GTSAM_PYTHON_BUILD_DIRECTORY}/gtsam/tests")

View File

@ -18,10 +18,12 @@ from gtsam.symbol_shorthand import B
class TestBasis(GtsamTestCase): class TestBasis(GtsamTestCase):
"""Tests Basis module python bindings """
Tests Basis module python bindings.
""" """
def test_fit_basis(self): def test_fit_basis(self):
"""Tests FitBasis python binding for FourierBasis, Chebyshev1Basis, Chebyshev2Basis, and """
Tests FitBasis python binding for FourierBasis, Chebyshev1Basis, Chebyshev2Basis, and
Chebyshev2. Chebyshev2.
It tests FitBasis by fitting to a ground-truth function that can be represented exactly in It tests FitBasis by fitting to a ground-truth function that can be represented exactly in
the basis, then checking that the regression (fit result) matches the function. For the the basis, then checking that the regression (fit result) matches the function. For the