Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
setup_requires=["setuptools-scm>2, <4"], # readthedocs needs it
extras_require={
"testing": [
"distro",
"pytest >= 3.0.0, <4",
"pytest-cov >= 2.5.1, <3",
"pytest-mock >= 1.10.0, <2",
Expand Down
27 changes: 18 additions & 9 deletions tests/unit/test_z_cmdline.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import os
import platform
import re
import shutil
import subprocess
import sys
import tempfile

import distro
import py
import pytest

Expand Down Expand Up @@ -630,15 +630,24 @@ def test_warning_emitted(cmd, initproj):
def _alwayscopy_not_supported():
# This is due to virtualenv bugs with alwayscopy in some platforms
# see: https://github.com/pypa/virtualenv/issues/565
if hasattr(platform, "linux_distribution"):
_dist = distro.linux_distribution(full_distribution_name=False)
(name, version, arch) = _dist
if any((name == "centos" and version[0] == "7", name == "SuSE" and arch == "x86_64")):
return True
return False
supported = True
tmpdir = tempfile.mkdtemp()
try:
with open(os.devnull) as fp:
subprocess.check_call(
[sys.executable, "-m", "virtualenv", "--always-copy", tmpdir], stdout=fp, stderr=fp
)
except subprocess.CalledProcessError:
supported = False
finally:
shutil.rmtree(tmpdir)
return not supported


@pytest.mark.skipif(_alwayscopy_not_supported(), reason="Platform doesnt support alwayscopy")
alwayscopy_not_supported = _alwayscopy_not_supported()


@pytest.mark.skipif(alwayscopy_not_supported, reason="Platform doesnt support alwayscopy")
def test_alwayscopy(initproj, cmd):
initproj(
"example123",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ include_trailing_comma = True
force_grid_wrap = 0
line_length = 99
known_first_party = tox,tests
known_third_party = apiclient,distro,docutils,filelock,git,httplib2,oauth2client,packaging,pkg_resources,pluggy,py,pytest,setuptools,six,sphinx,toml
known_third_party = apiclient,docutils,filelock,git,httplib2,oauth2client,packaging,pkg_resources,pluggy,py,pytest,setuptools,six,sphinx,toml

[testenv:release]
description = do a release, required posarg of the version number
Expand Down