1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/1b8bdf9ab87e/ Changeset: 1b8bdf9ab87e User: asmundg Date: 2013-04-06 10:17:58 Summary: Test that envsitepackagesdir actually gets called
It's hard to check that the system integration part is correct without reimplementing it in the test, but we can at least see if the method gets called and doesn't crash. Affected #: 1 file diff -r 2bedb02425da0785e6fab7a663bece85dc498299 -r 1b8bdf9ab87e87203df8543b8e5a85bc30433f52 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,6 +1,7 @@ import tox import pytest import os, sys +import subprocess from textwrap import dedent import py @@ -590,6 +591,35 @@ assert conf.changedir.basename == 'testing' assert conf.changedir.dirpath().realpath() == tmpdir.realpath() + @pytest.mark.xfailif("sys.platform == 'win32'") + def test_substitution_envsitepackagesdir(self, tmpdir, monkeypatch, + newconfig): + """ + The envsitepackagesdir property is mostly doing system work, + so this test doesn't excercise it very well. + + Usage of envsitepackagesdir on win32/jython will explicitly + throw an exception, + """ + class MockPopen(object): + returncode = 0 + + def __init__(self, *args, **kwargs): + pass + + def communicate(self, *args, **kwargs): + return 'onevalue', 'othervalue' + + monkeypatch.setattr(subprocess, 'Popen', MockPopen) + env = 'py%s' % (''.join(sys.version.split('.')[0:2])) + config = newconfig(""" + [testenv:%s] + commands = {envsitepackagesdir} + """ % (env)) + conf = config.envconfigs[env] + argv = conf.commands + assert argv[0][0] == 'onevalue' + class TestGlobalOptions: def test_notest(self, newconfig): Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org http://mail.python.org/mailman/listinfo/pytest-commit