summaryrefslogtreecommitdiff
path: root/_pytest/main.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2013-07-25 15:33:43 +0200
committerAnthon van der Neut <anthon@mnt.org>2013-07-25 15:33:43 +0200
commit15ec5a898c5e6ba289213ba1ca53564f73783bb5 (patch)
treeda561223496b74a42dd07a329d5fcd829f3941f4 /_pytest/main.py
parent9d9dd381bcb14c20953cd4a3fe33efdd57c083f0 (diff)
downloadpytest-15ec5a898c5e6ba289213ba1ca53564f73783bb5.tar.gz
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
Diffstat (limited to '_pytest/main.py')
-rw-r--r--_pytest/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/_pytest/main.py b/_pytest/main.py
index 775294c7d..6a39cb3bc 100644
--- a/_pytest/main.py
+++ b/_pytest/main.py
@@ -35,7 +35,7 @@ def pytest_addoption(parser):
dest="exitfirst",
help="exit instantly on first error or failed test."),
group._addoption('--maxfail', metavar="num",
- action="store", type="int", dest="maxfail", default=0,
+ action="store", type=int, dest="maxfail", default=0,
help="exit after first num failures or errors.")
group._addoption('--strict', action="store_true",
help="run pytest in strict mode, warnings become errors.")