Example #1
0
def skip_marker(f):
    return skip_windows(reason='Pythonz unavailable in Windows')(
        pytest.mark.skipif(
            sys.platform == 'cygwin',
            reason='Pythonz unavailable in Cygwin')(pytest.mark.skipif(
                os.environ.get('NIX'),
                reason='Pythonz unavailable in Nix')(connection_required(f))))
Example #2
0
def skip_marker(f):
    return skip_windows(reason='Pythonz unavailable in Windows')(
        pytest.mark.skipif(
            sys.platform == 'cygwin',
            reason='Pythonz unavailable in Cygwin')(
                pytest.mark.skipif(os.environ.get('NIX'),
                                   reason='Pythonz unavailable in Nix')(
                    connection_required(f))))
Example #3
0
from sys import platform
from subprocess import check_call
from pathlib import Path

from pew._utils import invoke_pew as invoke
from utils import skip_windows

import pytest

which_cmd = 'where' if platform == 'win32' else 'which'

pytestmark = skip_windows(
    reason='temporarily disable tests, due to issues with the virtualenv-clone'
    ' executable, maybe this bug? http://bugs.python.org/issue20614'
)


@pytest.yield_fixture()
def copied_env(workon_home, env1):
    invoke('cp', 'env1', 'destination', '-d')
    yield workon_home / 'destination'
    invoke('rm', 'destination')


def test_new_env_activated(workon_home, testpackageenv):
    invoke('cp', 'source', 'destination', '-d')
    testscript = Path(invoke('in', 'destination', which_cmd, 'testscript.py').out.strip())
    assert ('destination', 'testscript.py') == (testscript.parts[-3], testscript.parts[-1])
    with testscript.open() as f:
        assert str(workon_home / 'destination') in f.read()
    invoke('rm', 'destination')
Example #4
0
from sys import platform
from subprocess import check_call
from pathlib import Path

from pew._utils import invoke_pew as invoke
from utils import skip_windows

import pytest

which_cmd = 'where' if platform == 'win32' else 'which'

pytestmark = skip_windows(
    reason='temporarily disable tests, due to issues with the virtualenv-clone'
    ' executable, maybe this bug? http://bugs.python.org/issue20614')


@pytest.yield_fixture()
def copied_env(workon_home, env1):
    invoke('cp', 'env1', 'destination', '-d')
    yield workon_home / 'destination'
    invoke('rm', 'destination')


def test_new_env_activated(workon_home, testpackageenv):
    invoke('cp', 'source', 'destination', '-d')
    testscript = Path(
        invoke('in', 'destination', which_cmd, 'testscript.py').out.strip())
    assert ('destination', 'testscript.py') == (testscript.parts[-3],
                                                testscript.parts[-1])
    with testscript.open() as f:
        assert str(workon_home / 'destination') in f.read()
Example #5
0
import sys
import os
from subprocess import check_call
from pew._utils import invoke_pew as invoke
from utils import skip_windows
import pytest

pytestmark = skip_windows(reason='Pythonz is unsupported')(
    pytest.mark.skipif(sys.platform == 'cygwin', reason='Pythonz is unsupported')(
        pytest.mark.skipif(sys.version_info > (2,7) and os.environ.get('CI') == 'true',
            reason='Limit this slow and expensive test to the oldest '
            'Python version in the CI environment')))

def test_install():
    py_version = ['2.6.1', '--type', 'pypy']
    assert invoke('install', *py_version).returncode == 0
    py = invoke('locate_python', *py_version).out
    check_call([py, '-V'])

def test_uninstall():
    py_version = ['2.6.1', '--type', 'pypy']
    invoke('install', *py_version)
    assert invoke('uninstall', *py_version).returncode == 0
    assert invoke('locate_python', *py_version).returncode != 0