Beispiel #1
0
    url = "https://pypi.python.org/packages/source/P/Pylons/Pylons-0.9.6.2.tar.gz"
    subprocess.check_call(["wget", url], cwd=SRC_DIR)
    subprocess.check_call(["tar", "-zxf", "Pylons-0.9.6.2.tar.gz"], cwd=SRC_DIR)
    PYLONS_DIR = os.path.abspath(os.path.join(SRC_DIR, "Pylons-0.9.6.2"))

    subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PYLONS_DIR)
 
    # most of the errors are because of our coerceUnicodeToStr which raises a TypeError instead of a UnicodeError
    # but as we don't support the unicode string correctly every where I don't want to change this currently.
    expected = [{ "ran": 50, "errors": 7}]
    run_test([NOSE_EXE], cwd=PYLONS_DIR, expected=expected)
 
pkg = [ "Mako==1.0.3",
        "decorator==4.0.9",
        "simplejson==3.8.2",
        "FormEncode==1.3.0",
        "PasteScript==2.0.2",
        "PasteDeploy==1.5.2",
        "Paste==2.0.2",
        "Beaker==1.8.0",
        "WebHelpers==1.3",
        "Routes==2.2",
        "MarkupSafe==0.23",
        "six==1.10.0",
        "funcsigs==0.4",
        "repoze.lru==0.6",
        "nose==1.3.7"]

create_virtenv(ENV_NAME, pkg, force_create = True)
install_and_test_pylons()
Beispiel #2
0
    PATCH_FILE = os.path.abspath(
        os.path.join(os.path.dirname(__file__), "..", "integration",
                     "Cython-0.22.patch"))
    subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE],
                          cwd=CYTHON_DIR)
    print "Applied Cython patch"
    subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CYTHON_DIR)
    subprocess.check_call([PYTHON_EXE, "-c", "import Cython"], cwd=CYTHON_DIR)

    url = "https://pypi.python.org/packages/source/l/lxml/lxml-3.0.1.tar.gz"
    subprocess.check_call(["wget", url], cwd=SRC_DIR)
    subprocess.check_call(["tar", "-zxf", "lxml-3.0.1.tar.gz"], cwd=SRC_DIR)
    LXML_DIR = os.path.abspath(os.path.join(SRC_DIR, "lxml-3.0.1"))

    PATCH_FILE = os.path.abspath(
        os.path.join(os.path.dirname(__file__), "lxml_patch.patch"))
    subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE],
                          cwd=LXML_DIR)
    print "Applied lxml patch"

    subprocess.check_call(
        [PYTHON_EXE, "setup.py", "build_ext", "-i", "--with-cython"],
        cwd=LXML_DIR)

    expected = [{'ran': 1381, 'failures': 1}]
    run_test([PYTHON_EXE, "test.py"], cwd=LXML_DIR, expected=expected)


create_virtenv(ENV_NAME, None, force_create=True)
install_and_test_lxml()
Beispiel #3
0
import os, sys, subprocess
sys.path.append(os.path.dirname(__file__) + "/../lib")

from test_helper import create_virtenv, run_test

ENV_NAME = "avro_test_env_" + os.path.basename(sys.executable)
PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python"))
NOSETESTS_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests"))
AVRO_DIR = os.path.abspath(os.path.join(ENV_NAME, "avro-1.7.7"))

packages = ["nose==1.3.7", "avro==1.7.7"] 
create_virtenv(ENV_NAME, packages, force_create = True)

url = "https://pypi.python.org/packages/source/a/avro/avro-1.7.7.tar.gz"
subprocess.check_call(["wget", url], cwd=ENV_NAME)
subprocess.check_call(["tar", "-zxf", "avro-1.7.7.tar.gz"], cwd=ENV_NAME)

env = os.environ
env["PYTHONPATH"] = os.path.abspath(os.path.join(ENV_NAME, "site-packages"))

# this tests also fail when run in cpython with nose.
# pytest makes two of this work but we can't currently run pytest...
expected = [{'ran': 51, 'errors': 3}]
run_test([NOSETESTS_EXE], env=env, cwd=AVRO_DIR, expected=expected)
Beispiel #4
0
import os, sys
sys.path.append(os.path.dirname(__file__) + "/../lib")

from test_helper import create_virtenv, run_test

ENV_NAME = os.path.abspath("cheetah_test_env_" +
                           os.path.basename(sys.executable))
create_virtenv(ENV_NAME, ["cheetah==2.4.4", "Markdown==2.0.1"],
               force_create=True)

cheetah_exe = os.path.join(ENV_NAME, "bin", "cheetah")
env = os.environ
env["PATH"] = os.path.join(ENV_NAME, "bin")
expected = [{
    'ran': 2138,
    'errors': 4,
    'failures': 1
}, {
    'ran': 2138,
    'errors': 232,
    'failures': 3
}]
run_test([cheetah_exe, "test"], cwd=ENV_NAME, expected=expected, env=env)
Beispiel #5
0
import os, sys
sys.path.append(os.path.dirname(__file__) + "/../lib")

from test_helper import create_virtenv, run_test

ENV_NAME = os.path.abspath("pyopenssl_test_env_" + os.path.basename(sys.executable))
NOSETESTS_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests"))
PYOPENSSL_DIR = os.path.abspath(os.path.join(ENV_NAME, "site-packages", "OpenSSL"))

packages = ["nose==1.3.7", "pycparser==2.13", "cryptography==1.0.1", "pyopenssl==0.15.1", "pyasn1==0.1.7", "idna==2.0", "six==1.9.0", "enum34==1.0.4", "ipaddress==1.0.14", "cffi==1.1.0"]
create_virtenv(ENV_NAME, packages, force_create = True)

expected = [{'ran': 247, 'errors': 2}]
run_test([NOSETESTS_EXE], cwd=PYOPENSSL_DIR, expected=expected)
Beispiel #6
0
import os, sys, subprocess, shutil

sys.path.append(os.path.dirname(__file__) + "/../lib")

from test_helper import create_virtenv, run_test

ENV_NAME = "pytest_test_env_" + os.path.basename(sys.executable)
ENV_DIR = os.path.abspath(ENV_NAME)
SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src"))
PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python"))

pkg = ["pytest==2.8.2"]
create_virtenv(ENV_NAME, pkg)
PYTEST_DIR = os.path.abspath(os.path.join(SRC_DIR, "pytest"))

test_dir = os.path.join(ENV_DIR, "tests")
if not os.path.exists(test_dir):
    os.mkdir(test_dir)

with open(os.path.join(test_dir, "test_foo.py"), 'w') as f:
    f.write("""
import pytest
@pytest.mark.skipif(True, reason="for fun")
def test_skipif_true():
    1/0
""")

subprocess.check_call([os.path.join(ENV_DIR, "bin", "py.test"), test_dir])
# subprocess.check_call(["gdb", "--args", PYTHON_EXE, "-m", "pytest", test_dir])
Beispiel #7
0
import os, sys
sys.path.append(os.path.dirname(__file__) + "/../lib")

from test_helper import create_virtenv, run_test

ENV_NAME = os.path.abspath("cheetah_test_env_" + os.path.basename(sys.executable))
create_virtenv(ENV_NAME, ["cheetah==2.4.4", "Markdown==2.0.1"], force_create = True)

cheetah_exe = os.path.join(ENV_NAME, "bin", "cheetah")
env = os.environ
env["PATH"] = os.path.join(ENV_NAME, "bin")
expected = [{'ran': 2138}, {'ran': 2138, 'errors': 228, 'failures': 2}]
expected_log_hash = '''
jcoCAIUIQTJEDoDiMwAuQFEAKABjEbMAAAACgqAAAAGgGsGAaQQKg3l0AIQWbEAwIKQmkBIAAlOQ
IE4kA5AAASAqiGdMCPAAALKLAEwAYAcCEgRHAQCAAhAVJIghShwAUoAAKaEwgk0EaEUkgQAIADgb
pKTQYrIACAshhJ6Bwh0=
'''
run_test([cheetah_exe, "test"], cwd=ENV_NAME, expected=expected, env=env, expected_log_hash=expected_log_hash)
Beispiel #8
0
import test_helper


def print_progress_header(text):
    print "\n>>>"
    print ">>> " + text + "..."
    print ">>>"


ENV_NAME = "numpy_fulltest_env_" + os.path.basename(sys.executable)
DEPENDENCIES = ["nose==1.3.7"]

import platform
USE_CUSTOM_PATCHES = (platform.python_implementation() == "Pyston")

test_helper.create_virtenv(ENV_NAME, DEPENDENCIES)

SRC_DIR = ENV_NAME
ENV_DIR = os.path.abspath(ENV_NAME)
PYTHON_EXE = os.path.abspath(ENV_NAME + "/bin/python")
CYTHON_DIR = os.path.abspath(os.path.join(SRC_DIR, "cython-0.22"))
NUMPY_DIR = os.path.abspath(os.path.join(SRC_DIR, "numpy"))

print_progress_header("Setting up Cython...")
if not os.path.exists(CYTHON_DIR):

    url = "https://github.com/cython/cython/archive/0.22.tar.gz"
    subprocess.check_call(["wget", url, "-O", "Cython-0.22.tar.gz"],
                          cwd=SRC_DIR)
    subprocess.check_call(["tar", "-zxf", "Cython-0.22.tar.gz"], cwd=SRC_DIR)
Beispiel #9
0

def print_progress_header(text):
    print "\n>>>"
    print ">>> " + text + "..."
    print ">>>"


ENV_NAME = "numpy_fulltest_env_" + os.path.basename(sys.executable)
DEPENDENCIES = ["nose==1.3.7"]

import platform

USE_CUSTOM_PATCHES = platform.python_implementation() == "Pyston"

test_helper.create_virtenv(ENV_NAME, DEPENDENCIES)


SRC_DIR = ENV_NAME
ENV_DIR = os.path.abspath(ENV_NAME)
PYTHON_EXE = os.path.abspath(ENV_NAME + "/bin/python")
CYTHON_DIR = os.path.abspath(os.path.join(SRC_DIR, "cython-0.22"))
NUMPY_DIR = os.path.abspath(os.path.join(SRC_DIR, "numpy"))

print_progress_header("Setting up Cython...")
if not os.path.exists(CYTHON_DIR):

    url = "https://github.com/cython/cython/archive/0.22.tar.gz"
    subprocess.check_call(["wget", url, "-O", "Cython-0.22.tar.gz"], cwd=SRC_DIR)
    subprocess.check_call(["tar", "-zxf", "Cython-0.22.tar.gz"], cwd=SRC_DIR)
Beispiel #10
0
import os, sys, subprocess, shutil
sys.path.append(os.path.dirname(__file__) + "/../lib")

from test_helper import create_virtenv, run_test

ENV_NAME = "geoip_test_env_" + os.path.basename(sys.executable)
SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src"))
PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python"))

pkg = [
    "nose==1.3.7", "-e",
    "git+http://github.com/maxmind/[email protected]#egg=GeoIP"
]
create_virtenv(ENV_NAME, pkg, force_create=True)
GEOIP_DIR = os.path.abspath(os.path.join(SRC_DIR, "geoip"))
expected = [{'ran': 10}]

expected_log_hash = '''
ggAAAAAAQAQAAAAACAAAAAAAAAAAAAIABIAAAAAAgAACAAAAAAAIAAAAAAAAAAIIBAAAgABABAgA
AAAAAAAAAAAAAAAAAAAAAAQAAIgAAAAAAAAAAQBAABAAEAEAAAAAAAAAAAgAAAAIAIAAAAEAAAAA
AIAAAAgAAAAAAAAAAAA=
'''

run_test([PYTHON_EXE, "setup.py", "test"],
         cwd=GEOIP_DIR,
         expected=expected,
         expected_log_hash=expected_log_hash)
Beispiel #11
0
    url = "https://pypi.python.org/packages/source/c/cffi/cffi-1.2.1.tar.gz"
    subprocess.check_call(["wget", url], cwd=SRC_DIR)
    subprocess.check_call(["tar", "-zxf", "cffi-1.2.1.tar.gz"], cwd=SRC_DIR)
    CFFI_DIR = os.path.abspath(os.path.join(SRC_DIR, "cffi-1.2.1"))

    PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "cffi-1.2.1.patch"))
    subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CFFI_DIR)

    subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CFFI_DIR)

    # looks like clang 3.5 causes more errors like: 214 != -42 doing casts
    if os.environ.has_key("CC") and "clang" in os.environ["CC"]:
        expected = [{ "failed": 20, "passed": 1659, "skipped": 73, "xfailed": 4}]
        expected_log_hash = '''
        oRkAgDIgEgAAwoKiAIQAIABAQAAAAAIKBOAIUABAEAAAIMQFgQCKhKEgERFEMAgAAAIBAAiCCBAC
        CAIASESQBAQDpAEAAAogAAMBAoVQqkCKABBAAIDgAKECABJAAQiEIAAgAgOigAIwcoQBIAAACoAG
        2FIHAAQAJIELIVABgwA=
        '''
    else:
        expected = [{ "failed": 11, "passed": 1668, "skipped": 73, "xfailed": 4}]
        expected_log_hash = '''
        oRkAwBAg0gAEwoCiQIQgIQBAQAABQEKKBGAZVAhKcAAAAMQFAQAogKggFRFGEIgAAAKABgiGCBCC
        CAIASEAQHAQSpAEADEugCJEBAoFgIECDBBBEAACgACECAAJKgQicIAAgAAOChBIyUoQBIAAACoAG
        2FInAAQQpIEHARAJowE=
        '''
    run_test([PYTEST_EXE], cwd=CFFI_DIR, expected=expected, expected_log_hash=expected_log_hash)

create_virtenv(ENV_NAME, ["pytest==2.8.7", "py==1.4.31", "pycparser==2.14"], force_create = True)
install_and_test_cffi()
Beispiel #12
0
import os, sys, subprocess, shutil
sys.path.append(os.path.dirname(__file__) + "/../lib")

from test_helper import create_virtenv, run_test

ENV_NAME = "funcsigs_test_env_" + os.path.basename(sys.executable)
SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src"))
PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python"))

pkg = ["funcsigs==1.0.2"]
create_virtenv(ENV_NAME, pkg)
FUNCSIGS_DIR = os.path.abspath(os.path.join(SRC_DIR, "funcsigs"))

def test_error(meth_name):
    s = """
import funcsigs
try:
    print funcsigs.signature(%s)
    # assert 0
except ValueError as e:
    print e
    """ % meth_name
    s = s.strip()

    # subprocess.check_call(['gdb', "--args", PYTHON_EXE, '-c', s])
    subprocess.check_call([PYTHON_EXE, '-c', s])

def test_works(meth_name):
    s = """
import funcsigs
print funcsigs.signature(%s)
Beispiel #13
0
import os, sys
from test_helper import create_virtenv, run_test

ENV_NAME = os.path.abspath("cheetah_test_env_" + os.path.basename(sys.executable))
create_virtenv(ENV_NAME, ["cheetah==2.4.4"], force_create=True)

cheetah_exe = os.path.join(ENV_NAME, "bin", "cheetah")
env = os.environ
env["PATH"] = os.path.join(ENV_NAME, "bin")
expected = [{"ran": 2138, "errors": 4, "failures": 1}, {"ran": 2138, "errors": 232, "failures": 3}]
run_test([cheetah_exe, "test"], cwd=ENV_NAME, expected=expected, env=env)
Beispiel #14
0
import os, sys, subprocess, shutil
sys.path.append(os.path.dirname(__file__) + "/../lib")

from test_helper import create_virtenv, run_test

ENV_NAME = "typing_test_env_" + os.path.basename(sys.executable)
ENV_DIR = os.path.abspath(ENV_NAME)
PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python"))

pkg = ["typing==3.5.2.2"]
# pkg = ["git+https://github.com/python/[email protected]"]

create_virtenv(ENV_NAME, pkg, force_create=False)

# subprocess.check_call([PYTHON_EXE, os.path.join(ENV_DIR, "lib", "python2.7", "site-packages", "typing", "test_typing.py")])
# subprocess.check_call([PYTHON_EXE, "-m", "test_typing"])

print "Running some extra tests:"
test_fn = os.path.join(ENV_DIR, "test.py")
with open(test_fn, 'w') as f:
    f.write( """
import sys

from typing import Generic, TypeVar, Sequence
RR = TypeVar('RR')

for i in xrange(1000):
    Generic[RR]
    Sequence[RR]

print "Passed"
Beispiel #15
0
    CFFI_DIR = os.path.abspath(os.path.join(SRC_DIR, "cffi-1.2.1"))

    PATCH_FILE = os.path.abspath(
        os.path.join(os.path.dirname(__file__), "cffi-1.2.1.patch"))
    subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE],
                          cwd=CFFI_DIR)

    subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CFFI_DIR)

    # looks like clang 3.5 causes more errors like: 214 != -42 doing casts
    if os.environ.has_key("CC") and "clang" in os.environ["CC"]:
        expected = [{
            "failed": 20,
            "passed": 1659,
            "skipped": 73,
            "xfailed": 4
        }]
    else:
        expected = [{
            "failed": 11,
            "passed": 1668,
            "skipped": 73,
            "xfailed": 4
        }]
    run_test([PYTEST_EXE], cwd=CFFI_DIR, expected=expected)


create_virtenv(ENV_NAME, ["pytest==2.8.7", "py==1.4.31", "pycparser==2.14"],
               force_create=True)
install_and_test_cffi()
Beispiel #16
0
#-*- coding: utf-8 -*-
#flask test
#todo: It should be tested as django_test.py.
import os, sys, subprocess, shutil
import multiprocessing, time, signal
import urllib2

sys.path.append(os.path.dirname(__file__) + "/../lib")
from test_helper import create_virtenv, run_test

ENV_NAME = "flask_test_env_" + os.path.basename(sys.executable)
create_virtenv(ENV_NAME, 
               ["flask == 0.10.1", 
                "Werkzeug == 0.11.3",
                "jinja2 == 2.8", 
                "itsdangerous == 0.24", 
                "markupsafe == 0.23"]
               , force_create = True)

sys.path.append(ENV_NAME + "/lib/python2.7/site-packages")

from flask import Flask, Markup
from jinja2 import Template 

app = Flask(__name__)

@app.route('/')
def test_template():
    t = Template("Hello, World!: {% for n in range(1,10) %}{{n}} " "{% endfor %}")
    return t.render()
Beispiel #17
0
from test_helper import create_virtenv, run_test

ENV_NAME = "simplejson_test_env_" + os.path.basename(sys.executable)
SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src"))
PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python"))

def install_and_test_simplejson():
    shutil.rmtree(SRC_DIR, ignore_errors=True)
    os.makedirs(SRC_DIR)

    url = "https://pypi.python.org/packages/source/s/simplejson/simplejson-2.6.2.tar.gz"
    subprocess.check_call(["wget", url], cwd=SRC_DIR)
    subprocess.check_call(["tar", "-zxf", "simplejson-2.6.2.tar.gz"], cwd=SRC_DIR)
    SIMPLEJSON_DIR = os.path.abspath(os.path.join(SRC_DIR, "simplejson-2.6.2"))

    subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=SIMPLEJSON_DIR)
    subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=SIMPLEJSON_DIR)

    expected = [{'ran': 170}]
    expected_log_hash = '''
    gAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAA
    AAAAAAAAAAAAAAAAAEAAAAQAAAgAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAIAAAAAAAAAAAAAAAA=
    '''

    run_test([PYTHON_EXE, "setup.py", "test"], cwd=SIMPLEJSON_DIR, expected=expected, expected_log_hash=expected_log_hash)

create_virtenv(ENV_NAME, None, force_create = True)
install_and_test_simplejson()
Beispiel #18
0
import os, sys
from test_helper import create_virtenv, run_test

ENV_NAME = os.path.abspath("cheetah_test_env_" +
                           os.path.basename(sys.executable))
create_virtenv(ENV_NAME, ["cheetah==2.4.4"], force_create=True)

cheetah_exe = os.path.join(ENV_NAME, "bin", "cheetah")
env = os.environ
env["PATH"] = env["PATH"] + ":" + os.path.join(ENV_NAME, "bin")
expected = [{'errors': 4, 'failures': 53}, {'errors': 232, 'failures': 53}]
run_test([cheetah_exe, "test"], cwd=ENV_NAME, expected=expected, env=env)