Skip to content

Commit a4efe0d

Browse files
authored
Merge pull request #128 from ycexiao/use-string-in-structure
test: use filename string instead of pathlib.Path to fix tests using `diffpy.structure`
2 parents b94a3a9 + 685e8d5 commit a4efe0d

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

news/use-string-in-structure

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* No news added: Use filename string instead of pathlib.Path to fix the test using ``diffpy.structure``.
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

tests/test_pdf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def testGenerator(
160160

161161
stru = PDFFitStructure()
162162
ciffile = datafile("ni.cif")
163-
stru.read(ciffile)
163+
cif_path = str(ciffile)
164+
stru.read(cif_path)
164165
for i in range(4):
165166
stru[i].Bisoequiv = 1
166167
gen.setStructure(stru)
@@ -298,7 +299,9 @@ def test_pickling(
298299

299300
pc = PDFContribution("pdf")
300301
pc.loadData(datafile("ni-q27r100-neutron.gr"))
301-
ni = loadStructure(datafile("ni.cif"))
302+
ciffile = datafile("ni.cif")
303+
cif_path = str(ciffile)
304+
ni = loadStructure(cif_path)
302305
ni.Uisoequiv = 0.003
303306
pc.addStructure("ni", ni)
304307
pc.setCalculationRange(0, 10)

0 commit comments

Comments
 (0)