monkeypatch location from target (can be class/module/function or
string which is taken as importable python path)
examples:
monkeypatch.replace(os.path.abspath, lambda x: "")
monkeypatch.replace("requests.get", ...)
```
timeit result for 10000 iterations of expanding '/d' (lowered the count in the code afterwards)
# 2.7.5 3.3.2
# FilesCompleter 75.1109 69.2116
# FastFilesCompleter 0.7383 1.0760
```
- does not display prefix dir (like bash, not like compgen), py.test /usr/<TAB> does not show /usr/bin/ but bin/
don't use autouse fixtures for now because it would cause a proliferation
and overhead for the execution of every test. Rather introduce a
node.addfinalizer(fin) to attach a finalizer to the respective node
and call it from node.setup() functions if the setup phase succeeded
(i.e. there is no setup function or it finished successfully)
Mathieu Agopian for fixing. The patch moves handling setUpClass
into a new autofixture. (XXX impl-decide if rather adding addfinalizer()
API to node's would have a similar effect)
When an autouse fixture in a plugin was encountered None was stored as nodeid
where it used to be ''. This broke the lookup of autouse fixtures later on.
This also adds another test for the normal fixture ordering which was slightly
wrong: a fixture without location was always added at the front of the fixture
list rather then at the end of the fixtures without location but before the
fixtures with location.
- separate out most argcomplete related stuff in new file _argcomplete.py
(could probably be in the py library)
- allow positional arguments to be interspaced with optional arguments
( + test in test_parseopt.py )
- removed double argument in tox.ini
- add documentation on installing argcomplete (>=0.5.7 as needed for
Python 3), might need improving/incorporation in index.
This does not work on 2.5 yet. I have patches for argcomplete
(with/print()/"".format) but I am not sure they will be accepted.
Agreed with hpk not to push for that.
Removing argcomplete and leaving completion code active now works by early
exit, so <TAB> no longer re-runs the programs without parameters
(which took long for py.test)
test calls bash with a script that redirects filedescriptor 8 (as used by
argcomplete), so the result can be tested.
--HG--
branch : argcomplete