Merge pull request #4176 from ThomasWaldmann/pytest4-1.1

support pytest4 (1.1-maint backport)
This commit is contained in:
TW 2018-11-16 22:55:24 +01:00 committed by GitHub
commit a26f90f9fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 7 deletions

View File

@ -3,7 +3,7 @@ setuptools_scm
pip pip
virtualenv virtualenv
tox tox
pytest!=3.3.0 pytest
pytest-xdist pytest-xdist
pytest-cov pytest-cov
pytest-benchmark pytest-benchmark

View File

@ -55,7 +55,7 @@ from . import has_lchflags, has_llfuse
from . import BaseTestCase, changedir, environment_variable, no_selinux from . import BaseTestCase, changedir, environment_variable, no_selinux
from . import are_symlinks_supported, are_hardlinks_supported, are_fifos_supported, is_utime_fully_supported, is_birthtime_fully_supported from . import are_symlinks_supported, are_hardlinks_supported, are_fifos_supported, is_utime_fully_supported, is_birthtime_fully_supported
from .platform import fakeroot_detected from .platform import fakeroot_detected
from .upgrader import attic_repo from .upgrader import make_attic_repo
from . import key from . import key
# 3.4.3 == first version with argparse bugfix for nargs='*' and 0 arguments given # 3.4.3 == first version with argparse bugfix for nargs='*' and 0 arguments given
@ -2877,7 +2877,7 @@ id: 2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02
assert os.stat('input/dir1/source2').st_nlink == 2 assert os.stat('input/dir1/source2').st_nlink == 2
def test_detect_attic_repo(self): def test_detect_attic_repo(self):
path = attic_repo(self.repository_path) path = make_attic_repo(self.repository_path)
cmds = [ cmds = [
['create', path + '::test', self.tmpdir], ['create', path + '::test', self.tmpdir],
['extract', path + '::test'], ['extract', path + '::test'],

View File

@ -58,16 +58,20 @@ def key_valid(path):
return f.read().startswith(KeyfileKey.FILE_ID) return f.read().startswith(KeyfileKey.FILE_ID)
@pytest.fixture() def make_attic_repo(dir):
def attic_repo(tmpdir):
""" """
create an attic repo with some stuff in it create an attic repo with some stuff in it
:param tmpdir: path to the repository to be created :param dir: path to the repository to be created
:returns: path to attic repository :returns: path to attic repository
""" """
# there is some stuff in that repo, copied from `RepositoryTestCase.test1` # there is some stuff in that repo, copied from `RepositoryTestCase.test1`
return untar(ATTIC_TAR, str(tmpdir), 'repo') return untar(ATTIC_TAR, str(dir), 'repo')
@pytest.fixture()
def attic_repo(tmpdir):
return make_attic_repo(tmpdir)
@pytest.fixture(params=[True, False]) @pytest.fixture(params=[True, False])