Closed wd15 closed 6 years ago
Currently there are hardwired paths that depend on where the tests are executed. Replace these with paths that use the __file__ to determine the path. For example,
__file__
def test_get_aea(): - strt=Structure.from_file('../vasp/examples/SiOptb88/MAIN-ELASTIC-bulk@mp_149/POSCAR') - ar=get_area(strt) - assert ar==30.180025513225004 - + file_path = os.path.dirname(os.path.abspath(__file__)) + poscar_path = '../vasp/examples/SiOptb88/MAIN-ELASTIC-bulk@mp_149/POSCAR' + full_path = os.path.join(file_path, poscar_path) + print('full_path:', full_path) + strt=Structure.from_file(full_path) + ar=get_area(strt) + assert ar==30.180025513225004
implemented the os.path.join(os.path.dirname(file), '') to fix the problem.
Currently there are hardwired paths that depend on where the tests are executed. Replace these with paths that use the
__file__
to determine the path. For example,