Skip to content

Commit

Permalink
Clean up subtasks output
Browse files Browse the repository at this point in the history
The namespace depends on the test runner environment.
  • Loading branch information
mtpatter authored and Hsin-Fang Chiang committed Aug 17, 2016
1 parent 1a93531 commit 2392857
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/testShowTasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import StringIO
import unittest
import textwrap
import re

import lsst.utils.tests
import lsst.pex.config as pexConfig
Expand Down Expand Up @@ -74,13 +73,13 @@ def testBasicShowTaskHierarchy(self):
config = MainTaskConfig()
expectedData = """
Subtasks:
st1: name.TaskWithSubtasks
st1.sst1: name.SimpleTask
st1.sst2: name.SimpleTask
st2: name.TaskWithSubtasks
st2.sst1: name.SimpleTask
st2.sst2: name.SimpleTask
"""
st1: {0}.TaskWithSubtasks
st1.sst1: {0}.SimpleTask
st1.sst2: {0}.SimpleTask
st2: {0}.TaskWithSubtasks
st2.sst1: {0}.SimpleTask
st2.sst2: {0}.SimpleTask
""".format(__name__)
tempStdOut = StringIO.StringIO()
savedStdOut, sys.stdout = sys.stdout, tempStdOut
try:
Expand All @@ -89,7 +88,7 @@ def testBasicShowTaskHierarchy(self):
sys.stdout = savedStdOut
formatRead = tempStdOut.getvalue().strip()
formatExpected = textwrap.dedent(expectedData).strip()
self.assertEqual(re.sub('__main__|testShowTasks', 'name', formatRead), formatExpected)
self.assertEqual(formatRead, formatExpected)


class MyMemoryTestCase(lsst.utils.tests.MemoryTestCase):
Expand Down

0 comments on commit 2392857

Please sign in to comment.