diff --git a/conda-recipe/run_test.py b/conda-recipe/run_test.py index 5a592b5..e439c83 100644 --- a/conda-recipe/run_test.py +++ b/conda-recipe/run_test.py @@ -1,4 +1,4 @@ #!/usr/bin/env python import pyobjcryst.tests -assert pyobjcryst.tests.test().wasSuccessful() +assert pyobjcryst.tests.test(verbosity=2).wasSuccessful() diff --git a/src/pyobjcryst/tests/__init__.py b/src/pyobjcryst/tests/__init__.py index 8760647..209f3a8 100644 --- a/src/pyobjcryst/tests/__init__.py +++ b/src/pyobjcryst/tests/__init__.py @@ -63,7 +63,7 @@ def testsuite(pattern=''): return suite -def test(): +def test(verbosity=1): '''Execute all unit tests for the pyobjcryst package. Returns @@ -71,6 +71,6 @@ def test(): result : `unittest.TestResult` ''' suite = testsuite() - runner = unittest.TextTestRunner() + runner = unittest.TextTestRunner(verbosity=verbosity) result = runner.run(suite) return result diff --git a/src/pyobjcryst/tests/testpowderpattern.py b/src/pyobjcryst/tests/testpowderpattern.py index d95b4f9..419865b 100644 --- a/src/pyobjcryst/tests/testpowderpattern.py +++ b/src/pyobjcryst/tests/testpowderpattern.py @@ -154,6 +154,7 @@ def test_quick_fit(self): p.SetWavelength(0.7) x = np.linspace(0, 40, 8001) p.SetPowderPatternX(np.deg2rad(x)) + p.SetPowderPatternObs(np.ones_like(x)) pd = p.AddPowderPatternDiffraction(c) pd.SetReflectionProfilePar(ReflectionProfileType.PROFILE_PSEUDO_VOIGT, 1e-6) # p.plot(hkl=True) @@ -169,6 +170,7 @@ def test_peaklist_index(self): p.SetWavelength(0.7) x = np.linspace(0, 40, 16001) p.SetPowderPatternX(np.deg2rad(x)) + p.SetPowderPatternObs(np.ones_like(x)) pd = p.AddPowderPatternDiffraction(c) pd.SetReflectionProfilePar(ReflectionProfileType.PROFILE_PSEUDO_VOIGT, 1e-7) # p.plot(hkl=True) @@ -194,6 +196,7 @@ def test_spacegroup_explorer(self): p.SetWavelength(0.7) x = np.linspace(0, 40, 8001) p.SetPowderPatternX(np.deg2rad(x)) + p.SetPowderPatternObs(np.ones_like(x)) pd = p.AddPowderPatternDiffraction(c) pd.SetReflectionProfilePar(ReflectionProfileType.PROFILE_PSEUDO_VOIGT, 1e-6, 0, 0, 0, 0) # p.plot(hkl=True) @@ -224,6 +227,7 @@ def test_update_nbrefl(self): p.SetWavelength(1.5) x = np.linspace(0, 40, 4000) p.SetPowderPatternX(np.deg2rad(x)) + p.SetPowderPatternObs(np.ones_like(x)) pd = p.AddPowderPatternDiffraction(c) p.GetPowderPatternCalc() self.assertEqual(pd.GetNbRefl(), 89)