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

wcdolphin / flask-cors / 358 / 12
98%
master: 98%

Build:
DEFAULT BRANCH: master
Ran 19 Sep 2014 02:14PM UTC
Files 1
Run time 2s
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

19 Sep 2014 02:09PM UTC coverage: 96.992%. Remained the same
FLASK=0.9

Pull #74

travis-ci

wking
tests/base_test.py: Use __name__ for Flask's import_name

Avoid several test failures like:

  ======================================================================
  ERROR: test_credentialed_request (tests.test_credentials.AppConfigExposeHeadersTestCase)
  AppConfigExposeHeadersTestCase.test_credentialed_request
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/.../tests/base_test.py", line 82, in setUp
      self.app = Flask(self.__class__.__name__)
    File "/usr/lib64/python3.4/site-packages/flask/app.py", line 319, in __init__
      template_folder=template_folder)
    File "/usr/lib64/python3.4/site-packages/flask/helpers.py", line 741, in __init__
      self.root_path = get_root_path(self.import_name)
    File "/usr/lib64/python3.4/site-packages/flask/helpers.py", line 631, in get_root_path
      loader = pkgutil.get_loader(import_name)
    File "/usr/lib64/python3.4/pkgutil.py", line 469, in get_loader
      return find_loader(fullname)
    File "/usr/lib64/python3.4/pkgutil.py", line 490, in find_loader
      return spec.loader
  AttributeError: 'NoneType' object has no attribute 'loader'

on Python 3.4 [1].  The solution is to use an importable name [2]:

> About the First Parameter
>
> The idea of the first parameter is to give Flask an idea what
> belongs to your application. This name is used to find resources on
> the file system, can be used by extensions to improve debugging
> information and a lot more.
>
> So it’s important what you provide there. If you are using a single
> module, __name__ is always the correct value. If you however are
> using a package, it’s usually recommended to hardcode the name of
> your package there.

Previously we were using the class name (not the module name), but you
can't use that to import anything ;).

[1]: https://github.com/mitsuhiko/flask/issues/1011
[2]: http://flask.pocoo.org/docs/0.10/api/#flask.Flask
Pull Request #74: tests/base_test.py: Use __name__ for Flask's import_name

129 of 133 relevant lines covered (96.99%)

0.97 hits per line

Source Files on job 358.12 (FLASK=0.9)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 358
  • Travis Job 358.12
  • e8029791 on github
  • Prev Job for FLASK=0.9 on master (#357.12)
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

© 2026 Coveralls, Inc