Skip to content

Commit 9d94a09

Browse files
authored
rename for pytest
pytest wants names beginning with test_
1 parent bfcc77a commit 9d94a09

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/test_kvec.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,20 @@ def _ReportTest():
100100
print(f'testing {os.path.split(__file__)[1]} with {caller}')
101101

102102

103-
def TestAtomID():
103+
def test_AtomID():
104104
'''self-test #0: test the unique ID generation routine'''
105105
_ReportTest()
106106
atom_types = ["Cr", "Cr", "Cr", "Sb", "Sb", "Se"]
107107
atom_types_id = kvs.unique_id_gen(atom_types)
108108
msg = "Unique ID generation failed"
109109
assert atom_types_id == [1, 1, 1, 2, 2, 3], msg
110-
print("TestAtomID passed")
110+
print("test_AtomID passed")
111111

112112

113-
selftestlist.append(TestAtomID)
113+
selftestlist.append(test_AtomID)
114114

115115

116-
def TestLatConstruct():
116+
def test_LatConstruct():
117117
'''self-test #1: test the lattice vectors construction routine'''
118118
_ReportTest()
119119
cell_params = [5., 5., 5., 90, 90., 90.]
@@ -159,13 +159,13 @@ def TestLatConstruct():
159159
atol=1e-5
160160
), msg
161161

162-
print("TestLatConstruct passed")
162+
print("test_LatConstruct passed")
163163

164164

165-
selftestlist.append(TestLatConstruct)
165+
selftestlist.append(test_LatConstruct)
166166

167167

168-
def TestCriticalRoutines():
168+
def test_CriticalRoutines():
169169
'''self-test #2: test the critical routines'''
170170
_ReportTest()
171171
hkl_p = k_search.hklConvToPrim(nuc_p[2][:3])
@@ -184,10 +184,10 @@ def TestCriticalRoutines():
184184
), msg
185185

186186

187-
selftestlist.append(TestCriticalRoutines)
187+
selftestlist.append(test_CriticalRoutines)
188188

189189

190-
def TestKVecCandidateUpdate():
190+
def test_KVecCandidateUpdate():
191191
'''self-test #3: test the updating of the list of alternative k vectors'''
192192
_ReportTest()
193193

@@ -268,10 +268,10 @@ def TestKVecCandidateUpdate():
268268
), msg
269269

270270

271-
selftestlist.append(TestKVecCandidateUpdate)
271+
selftestlist.append(test_KVecCandidateUpdate)
272272

273273

274-
def TestKVecSearch():
274+
def test_KVecSearch():
275275
'''self-test #4: test the k vector search routine'''
276276
_ReportTest()
277277

@@ -426,7 +426,7 @@ def TestKVecSearch():
426426
), msg
427427

428428

429-
selftestlist.append(TestKVecSearch)
429+
selftestlist.append(test_KVecSearch)
430430

431431

432432
if __name__ == "__main__":

0 commit comments

Comments
 (0)