Changeset 17c9436 in sasview for test/pr_inversion


Ignore:
Timestamp:
Apr 11, 2017 10:31:54 AM (8 years ago)
Author:
krzywon
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
6bbe963e
Parents:
97c60f8
git-author:
Jeff Krzywon <krzywon@…> (04/11/17 10:31:54)
git-committer:
krzywon <krzywon@…> (04/11/17 10:31:54)
Message:

Remove all files dynamically genereated during unit testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/pr_inversion/test/utest_invertor.py

    rac07a3a r17c9436  
    88 
    99 
    10 import unittest, math, numpy 
     10 
     11import os 
     12import unittest 
     13import math 
     14import numpy 
    1115from sas.sascalc.pr.invertor import Invertor 
    12          
     16 
     17 
    1318class TestFiguresOfMerit(unittest.TestCase): 
    1419             
     
    416421         
    417422        # Save 
    418         self.invertor.to_file("test_output.txt") 
     423        f_name = "test_output.txt" 
     424        self.invertor.to_file(f_name) 
    419425     
    420426        # Load 
    421         self.invertor.from_file("test_output.txt") 
     427        self.invertor.from_file(f_name) 
    422428        self.assertEqual(self.invertor.d_max, 160.0) 
    423429        self.assertEqual(self.invertor.alpha, 0.0007) 
    424430        self.assertEqual(self.invertor.chi2, 836.797) 
    425431        self.assertAlmostEqual(self.invertor.pr(self.invertor.out, 10.0), 903.31577041, 4) 
     432        if os.path.isfile(f_name): 
     433            os.remove(f_name) 
    426434         
    427435    def test_qmin(self): 
Note: See TracChangeset for help on using the changeset viewer.