cubes icon indicating copy to clipboard operation
cubes copied to clipboard

2.0

Open sfermigier opened this issue 6 years ago • 3 comments

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

sfermigier avatar Jun 28 '19 15:06 sfermigier

@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.

KhaledTo avatar Jul 08 '19 19:07 KhaledTo

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.

sfermigier avatar Jul 08 '19 20:07 sfermigier

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

KhaledTo avatar Jul 09 '19 10:07 KhaledTo