• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

neithere / argh / 165 / 1
93%
master: 93%

Build:
DEFAULT BRANCH: master
Ran 06 Feb 2019 10:02PM UTC
Files 12
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Feb 2019 10:01PM UTC coverage: 90.101% (-0.2%) from 90.303%
165.1

Pull #134

travis-ci

web-flow
Fix bug with skip_unknown_args=True

Passing `skip_unknown_args=True` to the parser only ever showed the
usage message.

The problem is that `parser.parse_known_args()`
(`ArgumentParser.parse_known_args`) returns a tuple
`(namespace, remainder)` instead of just a namespace object like
`parser.parse_args`. Once you pass this to
`_get_function_from_namespace_obj` it gets confused.

The unit test was expecting to only ever show the usage message when
skipping unknown args.

The remaining unknown args are stored on the namespace as `_unkown_args`,
so it's at least accessible (if we use `@expects_obj`)

```python
import argh
parser = argh.ArghParser()

@argh.arg('a')
@argh.expects_obj
def foo(args):
    print 'foo args', args

parser.add_commands([foo, bar])
parser.dispatch(skip_unknown_args=True)
```
Pull Request #134: Fix bug with skip_unknown_args=True

446 of 495 relevant lines covered (90.1%)

0.9 hits per line

Source Files on job 165.1
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 165
  • Travis Job 165.1
  • 0ec77655 on github
  • Prev Job for on master (#158.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc