Skip to content

Commit 0f2ed66

Browse files
committed
all tests passing
1 parent 3c2073a commit 0f2ed66

1 file changed

Lines changed: 5 additions & 22 deletions

File tree

tests/test_pdf.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from diffpy.cmipdf import PDFContribution, PDFGenerator
2727
from diffpy.srfit.exceptions import SrFitError
2828
from diffpy.srfit.fitbase import ProfileParser
29-
from diffpy.structure import Structure
29+
from diffpy.structure import Structure, loadStructure
3030

3131
# ----------------------------------------------------------------------------
3232

@@ -203,11 +203,8 @@ def testGenerator(
203203
return
204204

205205

206-
def test_set_qmin(diffpy_structure_available, diffpy_srreal_available):
206+
def test_set_qmin():
207207
"""Verify qmin is propagated to the calculator object."""
208-
if not diffpy_srreal_available:
209-
pytest.skip("diffpy.srreal package not available")
210-
211208
gen = PDFGenerator()
212209
assert 0 == gen.get_qmin()
213210
assert 0 == gen._calc.qmin
@@ -229,25 +226,18 @@ def test_setQmax():
229226
return
230227

231228

232-
def test_get_qmax(diffpy_structure_available, diffpy_srreal_available):
229+
def test_get_qmax():
233230
"""Check PDFContribution.get_qmax()"""
234-
if not diffpy_structure_available:
235-
pytest.skip("diffpy.structure package not available")
236-
from diffpy.structure import Structure
237-
238-
if not diffpy_srreal_available:
239-
pytest.skip("diffpy.srreal package not available")
240-
241231
# cover all code branches in PDFContribution._get_meta_value
242232
# (1) contribution metadata
243233
pc1 = PDFContribution("pdf")
244234
assert pc1.get_qmax() is None
245-
pc1.setQmax(17)
235+
pc1.set_qmax(17)
246236
assert 17 == pc1.get_qmax()
247237
# (2) contribution metadata
248238
pc2 = PDFContribution("pdf")
249239
pc2.addStructure("empty", Structure())
250-
pc2.empty.setQmax(18)
240+
pc2.empty.set_qmax(18)
251241
assert 18 == pc2.get_qmax()
252242
# (3) profile metadata
253243
pc3 = PDFContribution("pdf")
@@ -286,13 +276,6 @@ def test_pickling(
286276
diffpy_structure_available, diffpy_srreal_available, datafile
287277
):
288278
"validate PDFContribution.residual() after pickling."
289-
if not diffpy_structure_available:
290-
pytest.skip("diffpy.structure package not available")
291-
from diffpy.structure import loadStructure
292-
293-
if not diffpy_srreal_available:
294-
pytest.skip("diffpy.srreal package not available")
295-
296279
pc = PDFContribution("pdf")
297280
pc.loadData(datafile("ni-q27r100-neutron.gr"))
298281
ciffile = datafile("ni.cif")

0 commit comments

Comments
 (0)