From 236fff00adf2d4cb4871506c7fa40bbe36bad23a Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Tue, 1 Oct 2013 16:33:15 +0200 Subject: [PATCH 1/2] complete_dotted: fix for #361, filecompleter on dot files had differing behaviour from bash Now if the prefix to expands ends in the directory seperator, then '..../.*' is globbed as well. --- _pytest/_argcomplete.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/_pytest/_argcomplete.py b/_pytest/_argcomplete.py index 8b4807c95..4f4eaf925 100644 --- a/_pytest/_argcomplete.py +++ b/_pytest/_argcomplete.py @@ -74,9 +74,13 @@ class FastFilesCompleter: else: prefix_dir = 0 completion = [] + globbed = [] if '*' not in prefix and '?' not in prefix: + if prefix[-1] == os.path.sep: # we are on unix, otherwise no bash + globbed.extend(glob(prefix + '.*')) prefix += '*' - for x in sorted(glob(prefix)): + globbed.extend(glob(prefix)) + for x in sorted(globbed): if os.path.isdir(x): x += '/' # append stripping the prefix (like bash, not like compgen) From 8ae79e09c0a2d1745bdbe3d5f9f2bc8cf87e2887 Mon Sep 17 00:00:00 2001 From: Andy Dirnberger Date: Tue, 1 Oct 2013 23:54:34 +0000 Subject: [PATCH 2/2] Adjust syntax for parametrize documentation Without the double colon, reStructuredText won't display treat the block that follows as pre-formatted text. Also, with this change comes the need to change a tab to spaces to align it with the adjacent lines. --HG-- branch : dirn/adjust-syntax-for-parametrize-documentat-1380671670976 --- doc/en/skipping.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/skipping.txt b/doc/en/skipping.txt index 36508ee15..8ca2188a1 100644 --- a/doc/en/skipping.txt +++ b/doc/en/skipping.txt @@ -183,7 +183,7 @@ Skip/xfail with parametrize --------------------------- It is possible to apply markers like skip and xfail to individual -test instances when using parametrize: +test instances when using parametrize:: import pytest @@ -191,7 +191,7 @@ test instances when using parametrize: (1, 2), pytest.mark.xfail((1, 0)), pytest.mark.xfail(reason="some bug")((1, 3)), - (2, 3), + (2, 3), (3, 4), (4, 5), pytest.mark.skipif("sys.version_info >= (3,0)")((10, 11)),