DataBrewery / cubes

[NOT MAINTAINED] Light-weight Python OLAP framework for multi-dimensional data analysis
http://cubes.databrewery.org
Other
1.49k stars 313 forks source link

2.0 #474

Open sfermigier opened 5 years ago

sfermigier commented 5 years ago

Fix tests, add tox config, modernise code (py 3.6 only).

KhaledTo commented 5 years ago

@sfermigier, can you explain how does it fix tests? To me it looks like you are commenting Test Suites, or is there something I'm missing? Anyways it's cool to see someone is still contributing to this project.

sfermigier commented 5 years ago

In commit 6af2aa9 I'm getting rid of the TestSuite objects which are redundant when using, as we do, pytest (pytest does its own discovery of the tests it has to run).

This fixes the two errors that were reported before this commit, due to non-existing test cases (ModelTestCase and AggregationBrowserTestCase) being put in the test suites without being defined.


    def test_suite():
        suite = unittest.TestSuite()

        suite.addTest(unittest.makeSuite(AttributeTestCase))
        suite.addTest(unittest.makeSuite(LevelTestCase))
        suite.addTest(unittest.makeSuite(HierarchyTestCase))
        suite.addTest(unittest.makeSuite(DimensionTestCase))
        suite.addTest(unittest.makeSuite(CubeTestCase))
>       suite.addTest(unittest.makeSuite(ModelTestCase))
E       NameError: name 'ModelTestCase' is not defined

tests/metadata/test_model.py:937: NameError
____________________________________________________________________________________ test_suite _____________________________________________________________________________________

    def test_suite():
        suite = unittest.TestSuite()

>       suite.addTest(unittest.makeSuite(AggregationBrowserTestCase))
E       NameError: name 'AggregationBrowserTestCase' is not defined

Also:

before this commit:

2 failed, 108 passed, 58 skipped, 4 warnings in 1.81 seconds

After this commit:

108 passed, 58 skipped, 10 warnings in 3.30 seconds

in other words, we have 110 non-skipped tests in both cases.

KhaledTo commented 5 years ago

Ok makes sense, also I forgot you branched from 2.0. Thank you @sfermigier.