Skip to content

Commit

Permalink
Add tox.ini for Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
wolever committed Nov 23, 2013
1 parent 8fe2f36 commit 0979300
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
from urllib import unquote
except ImportError: # python3
from urllib.parse import unquote

import random
import shutil
import threading
import tempfile
import unittest
import threading
import posixpath
import unittest2
import subprocess

try:
from SocketServer import ThreadingMixIn
from BaseHTTPServer import HTTPServer
Expand All @@ -23,7 +25,7 @@


BASE_PATH = os.path.abspath(os.path.dirname(__file__))
PKG_BASE_PATH = os.path.abspath(os.path.dirname(__file__)+"/../")
PKG_BASE_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "../")
sys.path.append(PKG_BASE_PATH)

from libpip2pi import commands as pip2pi_commands
Expand Down Expand Up @@ -98,8 +100,9 @@ def translate_path(self, path):
return path


class Pip2PiTests(unittest2.TestCase):
class Pip2PiTests(unittest.TestCase):
SERVER_PORT = random.randint(10000, 40000)

class BackgroundIt(threading.Thread):
server = None
def run(self):
Expand Down Expand Up @@ -170,4 +173,4 @@ def test_eggs_in_packages(self):
self.assertDirsEqual("test_eggs_in_packages/", self.temp_dir)

if __name__ == "__main__":
unittest2.main()
unittest.main()
6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[tox]
envlist = py27,py33

[testenv]
commands =
./run-tests

0 comments on commit 0979300

Please sign in to comment.