Changeset 464cd07 in sasview for src/sas/qtgui/Calculators


Ignore:
Timestamp:
Aug 22, 2017 5:59:29 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
b2a5042
Parents:
457d961
Message:

Use singleton QApplication in unit tests to avoid issues on Ubuntu. SASVIEW-485

Location:
src/sas/qtgui/Calculators
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Calculators/GenericScatteringCalculator.py

    • Property mode changed from 100755 to 100644
    r457d961 r464cd07  
    100100 
    101101        # plots - 3D in real space 
    102         self.trigger_plot_3d.connect(lambda: self.plot3d(has_arrow=False)) 
     102        plot3d = self.plot3d(has_arrow=False) 
     103        self.trigger_plot_3d.connect(plot3d) 
     104        #self.trigger_plot_3d.connect(lambda: self.plot3d(has_arrow=False)) 
    103105 
    104106        self.graph_num = 1  # index for name of graph 
  • src/sas/qtgui/Calculators/UnitTesting/DensityCalculatorTest.py

    r83eb5208 r464cd07  
    1919import sas.qtgui.Utilities.LocalConfig 
    2020 
    21 app = QtGui.QApplication(sys.argv) 
     21if not QtGui.QApplication.instance(): 
     22    app = QtGui.QApplication(sys.argv) 
    2223 
    2324class ToMolarMassTest(unittest.TestCase): 
  • src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py

    • Property mode changed from 100755 to 100644
    r457d961 r464cd07  
    2424from sas.sascalc.calculator import sas_gen 
    2525 
    26 app = QtGui.QApplication(sys.argv) 
     26if not QtGui.QApplication.instance(): 
     27    app = QtGui.QApplication(sys.argv) 
    2728 
    2829 
  • src/sas/qtgui/Calculators/UnitTesting/KiessigCalculatorTest.py

    r83eb5208 r464cd07  
    1111from sas.qtgui.Calculators.KiessigPanel import KiessigPanel 
    1212 
    13 app = QtGui.QApplication(sys.argv) 
     13if not QtGui.QApplication.instance(): 
     14    app = QtGui.QApplication(sys.argv) 
    1415 
    1516 
  • src/sas/qtgui/Calculators/UnitTesting/SLDCalculatorTest.py

    r83eb5208 r464cd07  
    2020import sas.qtgui.Utilities.LocalConfig 
    2121 
    22 app = QtGui.QApplication(sys.argv) 
     22if not QtGui.QApplication.instance(): 
     23    app = QtGui.QApplication(sys.argv) 
    2324 
    2425class SldResultTest(unittest.TestCase): 
  • src/sas/qtgui/Calculators/UnitTesting/SlitSizeCalculatorTest.py

    r83eb5208 r464cd07  
    1212from sas.sascalc.dataloader.loader import Loader 
    1313 
    14 app = QtGui.QApplication(sys.argv) 
     14if not QtGui.QApplication.instance(): 
     15    app = QtGui.QApplication(sys.argv) 
    1516 
    1617 
     
    8788                                self.widget.calculateSlitSize, data) 
    8889 
    89         filename = "empty_file.txt" 
    90         loader = Loader() 
    91         data = loader.load(filename) 
    92         self.assertRaisesRegexp(RuntimeError, 
    93                                 "ERROR: Data hasn't been loaded correctly", 
    94                                 self.widget.calculateSlitSize, data) 
    95  
    9690        data = None 
    9791        self.assertRaisesRegexp(RuntimeError, 
Note: See TracChangeset for help on using the changeset viewer.