Test both 2 and 3 differenlty

This commit is contained in:
Ann Paul 2017-10-08 21:13:50 -07:00
parent c17eb5fd0d
commit 2d33fb0936

View File

@ -7,7 +7,7 @@ test_pipreqs
Tests for `pipreqs` module. Tests for `pipreqs` module.
""" """
from io import BytesIO from io import BytesIO, StringIO
import unittest import unittest
import os import os
import requests import requests
@ -100,7 +100,10 @@ class TestPipreqs(unittest.TestCase):
Test that all modules we will test upon, are written out in alphabetic order Test that all modules we will test upon, are written out in alphabetic order
""" """
self.modules.extend(self.modules2) self.modules.extend(self.modules2)
if sys.version_info < (3, 0):
mock, sys.stdout = sys.stdout, BytesIO() mock, sys.stdout = sys.stdout, BytesIO()
else:
mock, sys.stdout = sys.stdout, StringIO()
pipreqs.init({'<path>': self.project, '--savepath': None, '--print': True, pipreqs.init({'<path>': self.project, '--savepath': None, '--print': True,
'--use-local': None, '--force': True, '--proxy': None, '--pypi-server': None, '--use-local': None, '--force': True, '--proxy': None, '--pypi-server': None,
'--diff': None, '--clean': None}) '--diff': None, '--clean': None})