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

agronholm / typeguard / 262 / 3
95%
master: 95%

Build:
DEFAULT BRANCH: master
Ran 22 Aug 2020 07:53PM UTC
Files 3
Run time 53s
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

22 Aug 2020 07:51PM UTC coverage: 87.574% (+0.1%) from 87.445%
COVERALLS_PARALLEL=true TOXENV=py36

push

travis-ci-com

web-flow
Correctly match package/module names in import hook (#144)

The previously used regular expression tried to handle both exact
matches and and prefix matches in one go, using this approach:

    re.compile(r'^%s\.?' % pkg)

However, this is incorrect, since the literal dot is optional in the
pattern, causing longer matches to also get included. For example, ‘foo’
should match ‘foo’ and ‘foo.bar’, but it also incorrectly matches
‘foobar’:

    >>> re.compile(r'^foo\.?').match('foobar')
    <_sre.SRE_Match object; span=(0, 3), match='foo'>

In practice, a command like this (using the pytest plugin as an example)
is supposed to check the ‘flask’ package and any modules below it:

    pytest --typeguard-packages=flask

... but in reality it also checks other packages, such as
‘flask_sqlalchemy’ and ‘flask_redis’, if those happen to be installed.

This can be easily fixed by not using regular expression, but simple
string matching instead.

592 of 676 relevant lines covered (87.57%)

0.88 hits per line

Source Files on job 262.3 (COVERALLS_PARALLEL=true TOXENV=py36)
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 236
  • Travis Job 262.3
  • 55fbcb57 on github
  • Prev Job for COVERALLS_PARALLEL=true TOXENV=py36 on master (#255.3)
  • Next Job for COVERALLS_PARALLEL=true TOXENV=py36 on master (#272.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc