Commit Graph

63 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 33cd414420 fix issue127 improve pytest_addoption docs, add new config.getoption(name) method for consistency. 2012-11-06 14:09:12 +01:00
holger krekel b8277bfed8 fix issue127 - improve pytest_addoption and related documentation 2012-10-25 11:07:07 +02:00
holger krekel ccc04b9fc4 some refinements to reporting and hook order 2012-06-21 11:07:22 +02:00
holger krekel 8307270cec yay! now that we have perfect teardowns we don't need some ugly internal hooks anymore. 2011-12-02 21:00:21 +00:00
holger krekel c4fe622b82 fix issue93 - avoid "delayed" teardowns for distributed testing by
simplifying handling of teardowns.
2011-12-02 21:00:19 +00:00
holger krekel 29bf205f3a make --durations also show the execution times of setup/teardown calls. This requires a slight incompatibility - pytest_runtest_logreport now sees setup/teardown reports even if the tests passed. 2011-11-08 17:53:46 +00:00
holger krekel ce1b456762 back out pytest_configure_funcargs hook for now 2011-06-01 15:08:54 +02:00
Ronny Pfannschmidt b6815538c5 introduce the pytest_configure_funcargs hook for better control on funcarg instanciation/configuration 2011-05-12 23:47:05 +02:00
holger krekel a15983cb33 rather named the new hook cmdline_preparse 2010-12-07 12:34:18 +01:00
holger krekel 7db9e98b55 introduce a pytest_cmdline_processargs hook to modify/add dynamically to command line arguments. 2010-12-07 12:14:12 +01:00
holger krekel 0357d3afda refine initialization and collection reporting, introduce a progress bar 2010-11-22 11:59:56 +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