Skip to content

Commit a9dfcd3

Browse files
committed
self-test path fixes
1 parent 741f916 commit a9dfcd3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/test_elm.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
import os
2+
import sys
3+
import importlib.util
4+
if importlib.util.find_spec('GSASII') is None: # hack path if GSASII not installed into Python
5+
home = os.path.dirname(__file__)
6+
sys.path.append(os.path.dirname(home))
7+
18
from GSASII import GSASIIElem
29

310
def test_get_xsection():
411
xsection = GSASIIElem.GetXsectionCoeff('Fe')
512
assert len(xsection) > 0
13+
14+
if __name__ == '__main__':
15+
# run self-tests
16+
test_get_xsection()
17+
print ("OK")

tests/test_lattice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
import numpy as np
77

8-
import importlib
8+
import importlib.util
99
if importlib.util.find_spec('GSASII') is None: # hack path if GSASII not installed into Python
1010
home = os.path.dirname(__file__)
1111
sys.path.append(os.path.dirname(home))

0 commit comments

Comments
 (0)