Skip to content

Commit

Permalink
Testing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrkerns committed Oct 24, 2018
1 parent 3971680 commit eedf25a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: python
python:
- "3.4"
- "3.5"
- "3.6"
- "3.7"

env:
- NUMPY=1.12
- NUMPY=1.13
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ def run_tests(directory, pattern='test*.py'):
# run test discovery
test_suite = unittest.defaultTestLoader.discover(directory, pattern)
# run test runner
runner.run(test_suite)
runner.run(test_suite)
13 changes: 12 additions & 1 deletion tests/_test_all.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
"""Test the entire package; an underscore precedes this file name
so it does not include itself in the test discovery."""
import os.path as osp
from tests import run_tests
import unittest

# from tests import run_tests


def run_tests(directory, pattern='test*.py'):
# import a runner to run tests
runner = unittest.TextTestRunner()
# run test discovery
test_suite = unittest.defaultTestLoader.discover(directory, pattern)
# run test runner
runner.run(test_suite)

test_dir = osp.dirname(__file__)
run_tests(test_dir)
4 changes: 2 additions & 2 deletions tests/test_tg51.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,5 +400,5 @@ class IMMC_TB_20E_Modern(TestTG51ElectronModern, TestCase):
m_reduced = 19.437
i_50 = 8.22
clinical_pdd = 96.8
dose_mu_dref = 0.980
dose_mu_dmax = 1.013
dose_mu_dref = 0.974
dose_mu_dmax = 1.006
6 changes: 3 additions & 3 deletions tests/test_trs398.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ class MDA_TB1_2015_10x(TestTRS398Photon, TestCase):
m_reduced = 27.635
clinical_pdd_zref = 73.5
dose_mu_zref = 0.734
dose_mu_zmax = 1.000
dose_mu_zmax = 0.998
tpr2010 = (73.42/73.7) * trs398.tpr2010_from_pdd2010(pdd2010=46.3/73.7)
open_pdf = True
print_data = True
# open_pdf = True
# print_data = True


class ACB5_2011_6x(TestTRS398Photon, TestCase):
Expand Down
6 changes: 2 additions & 4 deletions tests/test_vmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class VMATMixin:
klass = object
filepaths = Union[str, List]
is_zip = False
x_offset = 0
segment_positions = {1: Point(100, 200)}
segment_values = {
0: {'r_dev': 0, 'r_corr': 100},
Expand Down Expand Up @@ -133,11 +132,10 @@ class TestDRGSDemo(VMATMixin, TestCase):
avg_abs_r_deviation = 0.46
avg_r_deviation = 0
max_r_deviation = 0.96
x_offset = 20

def setUp(self):
self.vmat = DRGS.from_demo_images()
self.vmat.analyze(x_offset=self.x_offset)
self.vmat.analyze()

def test_demo(self):
"""Run the demo; no errors should arise."""
Expand All @@ -157,7 +155,7 @@ class TestDRMLCDemo(VMATMixin, TestCase):

def setUp(self):
self.vmat = DRMLC.from_demo_images()
self.vmat.analyze(x_offset=self.x_offset)
self.vmat.analyze()

def test_demo(self):
self.vmat.run_demo()
Expand Down

0 comments on commit eedf25a

Please sign in to comment.