source: sasview/test/run_one.py @ 751abab

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 751abab was bbd97e5, checked in by pkienzle, 11 years ago

Allow tests to be run without installing sasview

  • Property mode set to 100644
File size: 588 bytes
RevLine 
[bbd97e5]1import os
2import sys
3import xmlrunner
4import unittest
5import imp
6from os.path import abspath, dirname, split as splitpath, join as joinpath
7
8run_py = joinpath(dirname(dirname(abspath(__file__))), 'run.py')
9#print run_py
10run = imp.load_source('sasview_run', run_py)
11run.prepare()
12#print "\n".join(sys.path)
13test_path,test_file = splitpath(sys.argv[1])
14#print test_path, test_file
15sys.argv = [sys.argv[0]]
16os.chdir(test_path)
17sys.path.insert(0, test_path)
18test = imp.load_source('tests',test_file)
19unittest.main(test, testRunner=xmlrunner.XMLTestRunner(output='logs'))
20
Note: See TracBrowser for help on using the repository browser.