Commits

Marc Abramowitz  committed 7fb9ce6 Draft

Make tests in TestToxQuickstart more realistic by having them call tox._quickstart.process_input

  • Participants
  • Parent commits 2473a84

Comments (0)

Files changed (2)

File tests/test_quickstart.py

 class TestToxQuickstart(object):
     def test_pytest(self, tmpdir):
         d = {
-            'envlist': 'py24, py25, py26, py27, py32, py33, pypy',
+            'py24': True,
+            'py25': True,
+            'py26': True,
+            'py27': True,
+            'py32': True,
+            'py33': True,
+            'pypy': True,
             'commands': 'py.test',
             'deps': 'pytest',
         }
 
 [testenv]
 commands = py.test
-deps = pytest
+deps = 
+    pytest
 """.lstrip()
+        d = tox._quickstart.process_input(d)
         tox._quickstart.generate(d)
         result = open('tox.ini').read()
         # print(result)
 
     def test_setup_py_test(self, tmpdir):
         d = {
-            'envlist': 'py26, py27',
+            'py26': True,
+            'py27': True,
             'commands': 'python setup.py test',
             'deps': '',
         }
 [testenv]
 commands = python setup.py test
 deps = 
+    
 """.lstrip()
+        d = tox._quickstart.process_input(d)
         tox._quickstart.generate(d)
         result = open('tox.ini').read()
         # print(result)
 
     def test_trial(self, tmpdir):
         d = {
-            'envlist': 'py27',
+            'py27': True,
             'commands': 'trial',
             'deps': 'Twisted',
         }
 
 [testenv]
 commands = trial
-deps = Twisted
+deps = 
+    Twisted
 """.lstrip()
+        d = tox._quickstart.process_input(d)
         tox._quickstart.generate(d)
         result = open('tox.ini').read()
         # print(result)
 
     def test_nosetests(self, tmpdir):
         d = {
-            'envlist': 'py27, py32, py33, pypy',
+            'py27': True,
+            'py32': True,
+            'py33': True,
+            'pypy': True,
             'commands': 'nosetests -v',
             'deps': 'nose',
         }
 
 [testenv]
 commands = nosetests -v
-deps = nose
+deps = 
+    nose
 """.lstrip()
+        d = tox._quickstart.process_input(d)
         tox._quickstart.generate(d)
         result = open('tox.ini').read()
         # print(result)

File tox/_quickstart.py

 
 
 def process_input(d):
-    d['envlist'] = ', '.join([env for env in all_envs if d[env] is True])
+    d['envlist'] = ', '.join([env for env in all_envs if d.get(env) is True])
     d['deps'] = '\n' + '\n'.join(['    %s' % dep.strip() for dep in d['deps'].split(',')])
 
     return d