You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/04/11 21:46:59 UTC

[GitHub] betodealmeida commented on a change in pull request #4798: [DeckGL] Added fixtures and Deck test

betodealmeida commented on a change in pull request #4798: [DeckGL] Added fixtures and Deck test
URL: https://github.com/apache/incubator-superset/pull/4798#discussion_r180908278
 
 

 ##########
 File path: tests/utils.py
 ##########
 @@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
+
+import json
+
+FIXTURES_DIR = 'tests/fixtures'
 
 Review comment:
   This is a bit fragile, and might fail depending on from which directory you run the unit tests. There's a more robust way of handling this:
   
   1. Make sure the json files are in `MANIFEST.in`.
   2. Make sure `setup.py` has the line `include_package_data=True` (it has).
   3. You can now read the json content from using `pkg_resources.resource_filename` **no matter where it was installed**.
   
   For 1 & 2, see [this reference](http://python-packaging.readthedocs.io/en/latest/non-code-files.html). For 3, see [this reference](http://peak.telecommunity.com/DevCenter/PythonEggs#accessing-package-resources).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services