#3 added tests to the repository, but after merging a few PRs the tests are broken.
even if I git reset --hard d381ef9
I get the following errors
$ pytest -k test_here
============================= test session starts ==============================
platform linux -- Python 3.7.3, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
rootdir: /home/dchen/git/hub/pyprojroot
plugins: doctestplus-0.3.0, arraydiff-0.3, openfiles-0.3.2, remotedata-0.3.1
collected 25 items / 1 deselected / 24 selected
tests/test_pyprojroot.py .....F.....F.....F.....F [100%]
=================================== FAILURES ===================================
____________________________ test_here[stuff-.dvc] _____________________________
self = PosixPath('/.git')
def __str__(self):
"""Return the string representation of the path, suitable for
passing to system calls."""
try:
> return self._str
E AttributeError: _str
/home/dchen/anaconda3/lib/python3.7/pathlib.py:697: AttributeError
During handling of the above exception, another exception occurred:
tmpdir = PosixPath('/tmp/pytest-of-dchen/pytest-3/test_here_stuff__dvc_0')
proj_file = '.dvc', child_dir = 'stuff'
@pytest.mark.parametrize(
"proj_file",
[
".git",
".here",
"my_project.Rproj",
"requirements.txt",
"setup.py",
".dvc",
],
)
@pytest.mark.parametrize("child_dir", ["stuff", "src", "data", "data/hello"])
def test_here(tmpdir, proj_file, child_dir):
"""
This test uses pytest's tmpdir facilities to create a simulated project
directory, and checks that the path is correct.
"""
# Make proj_file
tmpdir = Path(tmpdir)
p = tmpdir / proj_file
with p.open("w") as fpath:
fpath.write("blah")
# Make child dirs
(tmpdir / child_dir).mkdir(parents=True)
os.chdir(tmpdir / child_dir)
assert os.getcwd() == str(tmpdir / child_dir)
# Check that proj
> path = here()
/home/dchen/git/hub/pyprojroot/tests/test_pyprojroot.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:15: in here
proj_path = pyprojroot(pl.Path('.').cwd(), proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
E RecursionError: maximum recursion depth exceeded while calling a Python object
!!! Recursion detected (same locals & position)
_____________________________ test_here[src-.dvc] ______________________________
self = PosixPath('/.git')
def __str__(self):
"""Return the string representation of the path, suitable for
passing to system calls."""
try:
> return self._str
E AttributeError: _str
/home/dchen/anaconda3/lib/python3.7/pathlib.py:697: AttributeError
During handling of the above exception, another exception occurred:
tmpdir = PosixPath('/tmp/pytest-of-dchen/pytest-3/test_here_src__dvc_0')
proj_file = '.dvc', child_dir = 'src'
@pytest.mark.parametrize(
"proj_file",
[
".git",
".here",
"my_project.Rproj",
"requirements.txt",
"setup.py",
".dvc",
],
)
@pytest.mark.parametrize("child_dir", ["stuff", "src", "data", "data/hello"])
def test_here(tmpdir, proj_file, child_dir):
"""
This test uses pytest's tmpdir facilities to create a simulated project
directory, and checks that the path is correct.
"""
# Make proj_file
tmpdir = Path(tmpdir)
p = tmpdir / proj_file
with p.open("w") as fpath:
fpath.write("blah")
# Make child dirs
(tmpdir / child_dir).mkdir(parents=True)
os.chdir(tmpdir / child_dir)
assert os.getcwd() == str(tmpdir / child_dir)
# Check that proj
> path = here()
/home/dchen/git/hub/pyprojroot/tests/test_pyprojroot.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:15: in here
proj_path = pyprojroot(pl.Path('.').cwd(), proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
E RecursionError: maximum recursion depth exceeded while calling a Python object
!!! Recursion detected (same locals & position)
_____________________________ test_here[data-.dvc] _____________________________
self = PosixPath('/.git')
def __str__(self):
"""Return the string representation of the path, suitable for
passing to system calls."""
try:
> return self._str
E AttributeError: _str
/home/dchen/anaconda3/lib/python3.7/pathlib.py:697: AttributeError
During handling of the above exception, another exception occurred:
tmpdir = PosixPath('/tmp/pytest-of-dchen/pytest-3/test_here_data__dvc_0')
proj_file = '.dvc', child_dir = 'data'
@pytest.mark.parametrize(
"proj_file",
[
".git",
".here",
"my_project.Rproj",
"requirements.txt",
"setup.py",
".dvc",
],
)
@pytest.mark.parametrize("child_dir", ["stuff", "src", "data", "data/hello"])
def test_here(tmpdir, proj_file, child_dir):
"""
This test uses pytest's tmpdir facilities to create a simulated project
directory, and checks that the path is correct.
"""
# Make proj_file
tmpdir = Path(tmpdir)
p = tmpdir / proj_file
with p.open("w") as fpath:
fpath.write("blah")
# Make child dirs
(tmpdir / child_dir).mkdir(parents=True)
os.chdir(tmpdir / child_dir)
assert os.getcwd() == str(tmpdir / child_dir)
# Check that proj
> path = here()
/home/dchen/git/hub/pyprojroot/tests/test_pyprojroot.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:15: in here
proj_path = pyprojroot(pl.Path('.').cwd(), proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
E RecursionError: maximum recursion depth exceeded while calling a Python object
!!! Recursion detected (same locals & position)
__________________________ test_here[data/hello-.dvc] __________________________
self = PosixPath('/.git')
def __str__(self):
"""Return the string representation of the path, suitable for
passing to system calls."""
try:
> return self._str
E AttributeError: _str
/home/dchen/anaconda3/lib/python3.7/pathlib.py:697: AttributeError
During handling of the above exception, another exception occurred:
tmpdir = PosixPath('/tmp/pytest-of-dchen/pytest-3/test_here_data_hello__dvc_0')
proj_file = '.dvc', child_dir = 'data/hello'
@pytest.mark.parametrize(
"proj_file",
[
".git",
".here",
"my_project.Rproj",
"requirements.txt",
"setup.py",
".dvc",
],
)
@pytest.mark.parametrize("child_dir", ["stuff", "src", "data", "data/hello"])
def test_here(tmpdir, proj_file, child_dir):
"""
This test uses pytest's tmpdir facilities to create a simulated project
directory, and checks that the path is correct.
"""
# Make proj_file
tmpdir = Path(tmpdir)
p = tmpdir / proj_file
with p.open("w") as fpath:
fpath.write("blah")
# Make child dirs
(tmpdir / child_dir).mkdir(parents=True)
os.chdir(tmpdir / child_dir)
assert os.getcwd() == str(tmpdir / child_dir)
# Check that proj
> path = here()
/home/dchen/git/hub/pyprojroot/tests/test_pyprojroot.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:15: in here
proj_path = pyprojroot(pl.Path('.').cwd(), proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
/home/dchen/git/hub/pyprojroot/pyprojroot/pyprojroot.py:10: in pyprojroot
return pyprojroot(p.parent, proj_files)
E RecursionError: maximum recursion depth exceeded while calling a Python object
!!! Recursion detected (same locals & position)
============== 4 failed, 20 passed, 1 deselected in 0.70 seconds ===============