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

wcdolphin / flask-cors / 358
98%

Build:
DEFAULT BRANCH: master
Ran 19 Sep 2014 02:10PM UTC
Jobs 11
Files 1
Run time 4min
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

pending completion
358

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%)

10.65 hits per line

Jobs
ID Job ID Ran Files Coverage
1 358.1 (FLASK=0.10.1) 19 Sep 2014 02:11PM UTC 0
96.24
Travis Job 358.1
2 358.2 (FLASK=0.10) 19 Sep 2014 02:11PM UTC 0
96.24
Travis Job 358.2
3 358.3 (FLASK=0.9) 19 Sep 2014 02:11PM UTC 0
96.24
Travis Job 358.3
4 358.4 (FLASK=0.10.1) 19 Sep 2014 02:10PM UTC 0
96.99
Travis Job 358.4
5 358.5 (FLASK=0.10) 19 Sep 2014 02:11PM UTC 0
96.99
Travis Job 358.5
6 358.6 (FLASK=0.9) 19 Sep 2014 02:12PM UTC 0
96.99
Travis Job 358.6
7 358.7 (FLASK=0.10.1) 19 Sep 2014 02:12PM UTC 0
96.99
Travis Job 358.7
8 358.8 (FLASK=0.10) 19 Sep 2014 02:12PM UTC 0
96.99
Travis Job 358.8
10 358.10 (FLASK=0.10.1) 19 Sep 2014 02:13PM UTC 0
96.99
Travis Job 358.10
11 358.11 (FLASK=0.10) 19 Sep 2014 02:14PM UTC 0
96.99
Travis Job 358.11
12 358.12 (FLASK=0.9) 19 Sep 2014 02:14PM UTC 0
96.99
Travis Job 358.12
Source Files on build 358
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #358
  • Pull Request #74
  • PR Base - master (#357)
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