Package diffpy :: Package pdffit2 :: Package tests :: Module pdffit2testutils
[hide private]
[frames] | no frames]

Source Code for Module diffpy.pdffit2.tests.pdffit2testutils

 1  #!/usr/bin/env python 
 2  ############################################################################## 
 3  # 
 4  # diffpy.srreal     by DANSE Diffraction group 
 5  #                   Simon J. L. Billinge 
 6  #                   (c) 2010 Trustees of the Columbia University 
 7  #                   in the City of New York.  All rights reserved. 
 8  # 
 9  # File coded by:    Pavol Juhas 
10  # 
11  # See AUTHORS.txt for a list of people who contributed. 
12  # See LICENSE.txt for license information. 
13  # 
14  ############################################################################## 
15   
16  """Helper routines for running other unit tests. 
17  Import of this module suppresses the chatty output from the C++ extension. 
18  """ 
19   
20   
21  import os.path 
22  import diffpy.pdffit2 
23   
24  # silence the C++ engine output 
25  diffpy.pdffit2.redirect_stdout(open(os.path.devnull, 'w')) 
26   
27  # path variables 
28  thisfile = locals().get('__file__', 'file.py') 
29  tests_dir = os.path.dirname(os.path.abspath(thisfile)) 
30  testdata_dir = os.path.join(tests_dir, 'testdata') 
31   
32 -def datafile(filename):
33 """prepend testdata_dir to filename. 34 """ 35 return os.path.join(testdata_dir, filename)
36 37 # End of file 38