Commit Graph

65 Commits

Author SHA1 Message Date
Anthon van der Neut 15ec5a898c moving from optparse to argparse. Major difficulty is
that argparse does not have Option objects -> added class Argument
Needed explicit call of MyOptionParser.format_epilog as argparse
does not have that. The parse_arg epilog argument wraps the text,
which is not the same (could be handled with a special formatter).

- parser.parse() now returns single argument (with positional args in
  .file_or_dir)
- "file_or_dir" made a class variable Config._file_or_dir and used in help and tests
- added code for argcomplete (because of which this all started!)

addoption:
- if option type is a string ('int' or 'string', this converted to
  int resp. str
- if option type is 'count' this is changed to the type of choices[0]

testing:
- added tests for Argument
- test_mark.test_keyword_extra split as ['-k', '-mykeyword'] generates argparse
  error test split in two and one marked as fail
- testing hints, multiline and more strickt (for if someone moves format_epilog
  to epilog argument of parse_args without Formatter)
- test for destination derived from long option with internal dash
- renamed second test_parseopt.test_parse() to test_parse2 as it was
  not tested at all (the first was tested.)

--HG--
branch : argparse
2013-07-25 15:33:43 +02:00
holger krekel a698465487 streamline docs, especially use "import pytest" and "pytest.*" in python code examples instead of "import py" and "py.test.*". 2010-11-17 22:12:16 +01:00
holger krekel 929291775e flat is better than nested (cont'd):
- pytest.py is new module, making "python -m pytest" work always
- _pytest/*.py now contains core.py, hookspec and the plugins, no sub packages
2010-11-13 11:10:45 +01:00
holger krekel b6ec5a575d get option settings from ini-file. make getting configuration options from conftest.py only an internal feature.
--HG--
branch : trunk
2010-10-31 17:41:58 +01:00
holger krekel 1280041f0c add and document new parser.addini(name, description) method to describe
ini-values. Also document the parser object with its public methods.

--HG--
branch : trunk
2010-10-30 19:23:50 +02:00
holger krekel c9e629c870 remove old ways to set option defaults, relying on global setup.cfg or tox.ini files now.
revamp py.test --help-config

--HG--
branch : trunk
2010-10-27 22:29:01 +02:00
holger krekel f3fb91e296 remove all deprecated functionality and tests
--HG--
branch : trunk
2010-10-13 18:41:53 +02:00
holger krekel 04c41cb672 shift config initialization to own "config" plugin
--HG--
branch : trunk
2010-10-12 15:34:32 +02:00
holger krekel 6631447161 merge config, pluginmanager, main into one file
--HG--
branch : trunk
2010-10-12 12:54:32 +02:00
holger krekel 32fce34825 move config to _config
--HG--
branch : trunk
2010-10-10 13:48:49 +02:00
holger krekel d1aff902d5 remove pylib things and move things to new pytest namespace
--HG--
branch : trunk
2010-10-07 11:59:00 +02:00
holger krekel f488da5cc8 merge parseopt into config module
--HG--
branch : trunk
2010-10-07 13:26:07 +02:00
Benjamin Peterson d93016d85f remove the unused return value of fnmatch_lines
--HG--
branch : trunk
2010-04-28 17:12:38 -05:00
holger krekel 9da1ba40ed move down py/impl/XYZ to py/_XYZ
--HG--
branch : trunk
2010-01-13 17:15:54 +01:00
holger krekel 5c27076d32 flatten test directory hierarchy and merge smaller into larger files
--HG--
branch : trunk
2010-01-13 16:17:50 +01:00