Comments (5)
@se7entyse7en I believe py.test requires a lot less work to write tests than unittest, although that may have changed with unittest2 now being part of Python 2.7. I say we stick with py.test unless there is a good reason to change?
from pydruid.
I'm not an expert about the various python testing tools, but I don't see great advantages that would let me choose py.test over the standard library unittest, but maybe just because I never used it. I took a very fast look at some other python projects to see which testing tools they use and I saw that actually projects such as flask and requests use pytest with requests using unittest and pytest for only some features. On the other hand django uses unittest. So I'm okay in using py.test.
from pydruid.
@xvrl I found pytest-cov
and I think it could be very usefull when writing tests in order to maximize the coverage of the project. Usage:
(pydruid)se7entyse7en@Marvins-MacBook-Air:~/Projects/pydruid (filtered_aggregation)$ py.test --cov-report term-missing --cov pydruid tests/
============================================================================== test session starts ===============================================================================
platform darwin -- Python 2.7.6 -- py-1.4.30 -- pytest-2.7.2
rootdir: /Users/se7entyse7en/Projects/pydruid, inifile:
plugins: cov
collected 10 items
tests/test_client.py ...s
tests/utils/test_aggregators.py ....
tests/utils/test_query_utils.py ..
---------------------------------------------------------------- coverage: platform darwin, python 2.7.6-final-0 -----------------------------------------------------------------
Name Stmts Miss Cover Missing
------------------------------------------------------------
pydruid/__init__ 0 0 100%
pydruid/client 162 91 44% 112-140, 143-147, 182, 190-198, 208-209, 212-216, 251-272, 310, 365-373, 412-419, 470-478, 516-520, 546-550, 589-596
pydruid/utils/__init__ 0 0 100%
pydruid/utils/aggregators 23 0 100%
pydruid/utils/filters 30 11 63% 30-42, 46, 49, 53, 57
pydruid/utils/having 42 20 52% 30-42, 46, 50-57, 61, 64, 67, 79, 82
pydruid/utils/postaggregator 34 9 74% 29, 33, 37, 45, 70-76
pydruid/utils/query_utils 21 1 95% 37
------------------------------------------------------------
TOTAL 312 132 58%
====================================================================== 9 passed, 1 skipped in 0.13 seconds =======================================================================
We could also integrate tox
in order to run tests for the different python versions and test pep8 compliancy.
from pydruid.
@se7entyse7en python test coverage sounds great! We could add a travis integration to get coverage stats like we do for https://github.com/druid-io/druid
from pydruid.
@xvrl I opened the pull-request #34 starting from pull-request #32 that contains a very basic configuration for travis CI.
from pydruid.
Related Issues (20)
- Feature idea: Leverage pydantic for query validation
- JSONDecodeError: Expecting ',' delimiter: line 1 column 7060430653 (char 7060430652)
- Evaluating query runtime without output HOT 1
- PyDruid for Data Ingestion in Druid HOT 2
- Version 0.6.3 is broken if you don't already have sqlalchemy installed
- Getting columns for a Druid datasource fails with a KeyError HOT 2
- Subquery not getting converted property HOT 2
- "do_ping" broken in last pydruid release, can't add a Druid as a new Database in Superset, need a pydruid release HOT 10
- Support newer Python versions
- ssl_client_cert passed is being assigned to proxies in Cursor object
- Support for multi-stage-query (sql-msq-task) HOT 1
- Is there a way to query for stats aggregator (STDDEV)?
- Pandas 2.0 dtype_backend="pyarrow"
- Column name not identified on certain special characters
- Querying list of data sources HOT 2
- pydruid not compatible with druid 27 HOT 2
- Is this project currently maintained?
- Error when calling the async client
- inadvertent hard dependency on sqlalchemy
- Row counter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydruid.