Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request #386 from pybee/topic/parallelise
Browse files Browse the repository at this point in the history
Use pytest and pytest-circleci to enable parallelism
  • Loading branch information
freakboy3742 committed Dec 3, 2016
2 parents 4e10caf + ddec0fd commit 84bd4db
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion circle.yml
Expand Up @@ -17,5 +17,6 @@ test:
- sudo service mysql stop || true
- sudo service postgresql stop || true
override:
- "python setup.py test":
- "pip install pytest; pip install git+https://github.com/pybee/pytest-circleci; py.test tests":
timeout: 60
parallel: true
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,2 +1,2 @@
[pytest]
[tools:pytest]
addopts = --ignore node_modules
8 changes: 4 additions & 4 deletions tests/modules/test__compile.py
Expand Up @@ -2,7 +2,7 @@

import unittest

def testTokenize(self, source, expected):
def assertTokenizaton(self, source, expected):
self.assertJavaScriptExecution("""
import _compile
s = %s
Expand All @@ -17,7 +17,7 @@ def testTokenize(self, source, expected):

class CompileTests(TranspileTestCase):
def test_basic_tokenize(self):
testTokenize(self, "x = 1; fun.w3 -= 14.0e4j",
assertTokenizaton(self, "x = 1; fun.w3 -= 14.0e4j",
"""
0 NAME x
1 EQUAL =
Expand All @@ -31,7 +31,7 @@ def test_basic_tokenize(self):
""")

def test_multiline_tokenize(self):
testTokenize(self, '''
assertTokenizaton(self, '''
LOOPS = 50000
from time import clock
Expand Down Expand Up @@ -79,7 +79,7 @@ def test_multiline_tokenize(self):
""")

def test_pystone_tokenize(self):
testTokenize(self, '''
assertTokenizaton(self, '''
LOOPS = 50000
from time import clock
Expand Down
14 changes: 7 additions & 7 deletions tests/modules/test_stdlib.py
Expand Up @@ -5,30 +5,30 @@
# do basic tests for now
# TODO: execute complete tests for each stdlib module

def test_module(self, name, exclude=[]):
def _test_module(self, name, exclude=[]):
self.assertCodeExecution("""
import %s
print(sorted([x for x in list(dir(%s)) if not x.startswith('_') and x not in set(%s)]))
""" % (name, name, repr(exclude)), run_in_function=False)

class StdlibTests(TranspileTestCase):
def test__weakref(self):
test_module(self, "_weakref")
_test_module(self, "_weakref")

def test__weakrefset(self):
test_module(self, "_weakrefset")
_test_module(self, "_weakrefset")

def test_abc(self):
test_module(self, "abc", exclude=['ref'])
_test_module(self, "abc", exclude=['ref'])

def test_bisect(self):
test_module(self, "bisect")
_test_module(self, "bisect")

def test_colorsys(self):
test_module(self, "colorsys")
_test_module(self, "colorsys")

def test_copyreg(self):
test_module(self, "copyreg")
_test_module(self, "copyreg")

def test_token(self):
# our version doesn't quite sync up
Expand Down

0 comments on commit 84bd4db

Please sign in to comment.