Skip to content

Commit ac23c4c

Browse files
committed
chore: add sasmodels to requirements folder and move load_standard_models() into the test functions
1 parent 1bdd326 commit ac23c4c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tests/test_characteristicfunctions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
import diffpy.srfit.pdf.characteristicfunctions as cf
2424

25-
load_standard_models()
26-
2725
# # Global variables to be assigned in setUp
2826
# cf = None
2927
# Fixme: remove this code if imports don't break on testing
@@ -39,6 +37,8 @@ def testSphere(sas_available):
3937
+ "remove skip when our code is refactored to use the "
4038
+ "latest sasview API"
4139
)
40+
41+
load_standard_models()
4242
radius = 25
4343
# Calculate sphere cf from SphereModel
4444
SphereModel = find_model("sphere")
@@ -65,6 +65,8 @@ def testSpheroid(sas_available):
6565
+ "remove skip when our code is refactored to use the "
6666
+ "latest sasview API"
6767
)
68+
69+
load_standard_models()
6870
prad = 20.9
6971
erad = 33.114
7072
# Calculate cf from EllipsoidModel
@@ -93,6 +95,8 @@ def testShell(sas_available):
9395
+ "remove skip when our code is refactored to use the "
9496
+ "latest sasview API"
9597
)
98+
99+
load_standard_models()
96100
radius = 19.2
97101
thickness = 7.8
98102
# Calculate cf from VesicleModel
@@ -121,6 +125,7 @@ def testCylinder(sas_available):
121125
+ "remove skip when our code is refactored to use the "
122126
+ "latest sasview API"
123127
)
128+
load_standard_models()
124129
"""Make sure cylinder works over different r-ranges."""
125130
radius = 100
126131
length = 30

tests/test_sas.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
from diffpy.srfit.sas import SASGenerator, SASParser, SASProfile
2424

25-
load_standard_models()
26-
2725
# ----------------------------------------------------------------------------
2826
# FIXME: adjust sensitivity of the pytest.approx statements when ready to test
2927
# with sasview installed.
@@ -33,6 +31,7 @@ def testParser(sas_available, datafile):
3331
if not sas_available:
3432
pytest.skip("sas package not available")
3533

34+
load_standard_models()
3635
data = datafile("sas_ascii_test_1.txt")
3736
parser = SASParser()
3837
parser.parseFile(data)
@@ -117,6 +116,7 @@ def testParser(sas_available, datafile):
117116
def test_generator(sas_available):
118117
if not sas_available:
119118
pytest.skip("sas package not available")
119+
load_standard_models()
120120
SphereModel = find_model("sphere")
121121
model = SphereModel()
122122
gen = SASGenerator("sphere", model)
@@ -144,6 +144,7 @@ def test_generator(sas_available):
144144
def testGenerator2(sas_available, datafile):
145145
if not sas_available:
146146
pytest.skip("sas package not available")
147+
load_standard_models()
147148
EllipsoidModel = find_model("ellipsoid")
148149
model = EllipsoidModel()
149150
gen = SASGenerator("ellipsoid", model)

0 commit comments

Comments
 (0)