-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DeckGL] Added fixtures and Deck test #4798
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4798 +/- ##
==========================================
+ Coverage 72.38% 72.46% +0.08%
==========================================
Files 208 208
Lines 15526 15530 +4
Branches 1203 1203
==========================================
+ Hits 11238 11254 +16
+ Misses 4285 4273 -12
Partials 3 3
Continue to review full report at Codecov.
|
tests/utils.py
Outdated
|
||
import json | ||
|
||
FIXTURES_DIR = 'tests/fixtures' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
- Make sure the json files are in
MANIFEST.in
. - Make sure
setup.py
has the lineinclude_package_data=True
(it has). - 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. For 3, see this reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also just have the fixtures be defined as python data structures and json.dumps
them if/when needed. Personally I rarely write JSON as I don't like the fact it doesn't support trailing commas and triple quoted strings.
* added fixtures and deck test * linting * linting * add os.path * remove para * fix reference
* added fixtures and deck test * linting * linting * add os.path * remove para * fix reference
* added fixtures and deck test * linting * linting * add os.path * remove para * fix reference
Add utils.py for better testing examples moving that can be loaded from a json
@betodealmeida @mistercrunch