
"""Tests for setup.py."""

import doctest
import os
import subprocess
import sys

from testtools import (
    TestCase,
    )
from testtools.matchers import (
    DocTestMatches,
    )

class TestCanSetup(TestCase):

    def test_bdist(self):
        # Single smoke test to make sure we can build a package.
        path = os.path.join(os.path.dirname(__file__), '..', '..', 'setup.py')
        proc = subprocess.Popen([sys.executable, path, 'bdist'],
            stdin=subprocess.PIPE, stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT)
        output, _ = proc.communicate()
        self.assertEqual(0, proc.returncode)
        self.assertThat(output,
            DocTestMatches("...running bdist...", doctest.ELLIPSIS))


"""Tests for setup.py."""

import doctest
import os
import subprocess
import sys

from testtools import (
    TestCase,
    )
from testtools.matchers import (
    DocTestMatches,
    )

class TestCanSetup(TestCase):

    def test_bdist(self):
        # Single smoke test to make sure we can build a package.
        path = os.path.join(os.path.dirname(__file__), '..', '..', 'setup.py')
        proc = subprocess.Popen([sys.executable, path, 'bdist'],
            stdin=subprocess.PIPE, stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT, universal_newlines=True)
        output, _ = proc.communicate()
        self.assertEqual(0, proc.returncode)
        self.assertThat(output, DocTestMatches("""...
running install_scripts
...
adding '...testr'
...""", doctest.ELLIPSIS))

Make setup.py smoke test more specific again as requested in review
Make setup.py smoke test more specific again as requested in review
  
  """Tests for setup.py."""
  
  import doctest
  import os
  import subprocess
  import sys
  
  from testtools import (
      TestCase,
      )
  from testtools.matchers import (
      DocTestMatches,
      )
  
  class TestCanSetup(TestCase):
  
      def test_bdist(self):
          # Single smoke test to make sure we can build a package.
          path = os.path.join(os.path.dirname(__file__), '..', '..', 'setup.py')
          proc = subprocess.Popen([sys.executable, path, 'bdist'],
              stdin=subprocess.PIPE, stdout=subprocess.PIPE,
-             stderr=subprocess.STDOUT)
+             stderr=subprocess.STDOUT, universal_newlines=True)
          output, _ = proc.communicate()
          self.assertEqual(0, proc.returncode)
-         self.assertThat(output,
-             DocTestMatches("...running bdist...", doctest.ELLIPSIS))
+         self.assertThat(output, DocTestMatches("""...
+ running install_scripts
+ ...
+ adding '...testr'
+ ...""", doctest.ELLIPSIS))
  
Make setup.py smoke test more specific again as requested in review
## Code Before:

"""Tests for setup.py."""

import doctest
import os
import subprocess
import sys

from testtools import (
    TestCase,
    )
from testtools.matchers import (
    DocTestMatches,
    )

class TestCanSetup(TestCase):

    def test_bdist(self):
        # Single smoke test to make sure we can build a package.
        path = os.path.join(os.path.dirname(__file__), '..', '..', 'setup.py')
        proc = subprocess.Popen([sys.executable, path, 'bdist'],
            stdin=subprocess.PIPE, stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT)
        output, _ = proc.communicate()
        self.assertEqual(0, proc.returncode)
        self.assertThat(output,
            DocTestMatches("...running bdist...", doctest.ELLIPSIS))

## Instruction:
Make setup.py smoke test more specific again as requested in review
## Code After:

"""Tests for setup.py."""

import doctest
import os
import subprocess
import sys

from testtools import (
    TestCase,
    )
from testtools.matchers import (
    DocTestMatches,
    )

class TestCanSetup(TestCase):

    def test_bdist(self):
        # Single smoke test to make sure we can build a package.
        path = os.path.join(os.path.dirname(__file__), '..', '..', 'setup.py')
        proc = subprocess.Popen([sys.executable, path, 'bdist'],
            stdin=subprocess.PIPE, stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT, universal_newlines=True)
        output, _ = proc.communicate()
        self.assertEqual(0, proc.returncode)
        self.assertThat(output, DocTestMatches("""...
running install_scripts
...
adding '...testr'
...""", doctest.ELLIPSIS))
