Skip to content

Commit

Permalink
test(conftest): make cwd in @pytest.mark.bashcomp relative from fixtures
Browse files Browse the repository at this point in the history
@pytest.mark.bashcomp(cwd=path), which has been recently added in
commit 2ed0e85, had interpreted "cwd" as the relative path to the
pytest's working directory.  Now this commit makes "cwd" the relative
path to the directory "test/fixtures".

Note that @pytest.mark.bashcomp(cwd=path) has never been used so far
since this is added just for completeness when
@pytest.mark.bashcomp(temp_cwd=True) was supported.  This will be used
for the subsequent commits for the completion of "make".
  • Loading branch information
akinomyoga committed Aug 24, 2021
1 parent c2e06e0 commit fa3243e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/t/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ def bash(request) -> pexpect.spawn:
cwd = None
if marker:
if "cwd" in marker.kwargs and marker.kwargs.get("cwd") is not None:
cwd = marker.kwargs.get("cwd")
cwd = os.path.join(
testdir, "fixtures", marker.kwargs.get("cwd")
)
elif "temp_cwd" in marker.kwargs and marker.kwargs.get("temp_cwd"):
tmpdir = tempfile.TemporaryDirectory(
prefix="bash-completion-test_"
Expand Down

0 comments on commit fa3243e

Please sign in to comment.