blaze / datashape

Language defining a data description protocol
BSD 2-Clause "Simplified" License
183 stars 65 forks source link

test_coretypes.py misses importing raises in -0.4.1 #115

Closed idella closed 9 years ago

idella commented 9 years ago
datashape/tests/test_util.py::TestDataShapeUtil::test_has_ellipsis  *       py.test -v || die "Tests failed under ${EPYTHON}"
PASSED
datashape/tests/test_util.py::TestDataShapeUtil::test_has_var_dim PASSED * 

===================== FAILURES ==========================
____________________________________________ test_error_on_datashape_with_string_argument ____________________________________________

    def test_error_on_datashape_with_string_argument():
>       assert raises(TypeError, lambda : DataShape('5 * int32'))
E       NameError: global name 'raises' is not defined

datashape/tests/test_coretypes.py:31: NameError
======= 1 failed, 193 passed, 8 xfailed in 1.64 seconds ==================

add from datashape.internal_utils import raises to datashape/tests/test_coretypes.py sees it pass

============= 194 passed, 8 xfailed in 1.57 seconds =============
>>> Completed testing dev-python/datashape-0.4.1
mrocklin commented 9 years ago

Hrm, do you have an up-to-date datashape?

That test looks like this in master

def test_error_on_datashape_with_string_argument():
    assert pytest.raises(TypeError, lambda : DataShape('5 * int32'))

https://github.com/ContinuumIO/datashape/blob/master/datashape/tests/test_coretypes.py#L31-L32

idella commented 9 years ago

you appear to be missing the point. The suite ran the test and it failed. The file datashape/tests/test_coretypes.py is missing importing raises, add

"from datashape.internal_utils import raises" to it sees it pass

mrocklin commented 9 years ago

I continue to miss the point unfortunately. Datashape no longer uses the internal_utils.raises function in any test in the code base. Can you verify that you are running from git master?

A pull request with an explicit fix would probably make the issue more clear.

idella commented 9 years ago

No I am not running from git master. I am running what came in the tarball. It's the release -0.4.1 I am testing, not master.

~/cvsPortage/gentoo-x86/dev-python/datashape $ grep raises -r /mnt/gen2/TmpDir/portage/dev-python/datashape-0.4.1/work
/mnt/gen2/TmpDir/portage/dev-python/datashape-0.4.1/work/datashape-0.4.1/datashape/internal_utils.py:def raises(exception, lamda):
/mnt/gen2/TmpDir/portage/dev-python/datashape-0.4.1/work/datashape-0.4.1/datashape/py2help.py:    raises = pytest.raises
/mnt/gen2/TmpDir/portage/dev-python/datashape-0.4.1/work/datashape-0.4.1/datashape/tests/test_coretypes.py:    assert raises(TypeError, lambda : DataShape('5 * int32'))
/mnt/gen2/TmpDir/portage/dev-python/datashape-0.4.1/work/datashape-0.4.1/datashape/tests/test_coretypes.py:        with pytest.raises(error.DataShapeSyntaxError):
/mnt/gen2/TmpDir/portage/dev-python/datashape-0.4.1/work/datashape-0.4.1/datashape/tests/test_coretypes.py:        with pytest.raises(error.DataShapeSyntaxError):
/mnt/gen2/TmpDir/portage/dev-python/datashape-0.4.1/work/datashape-0.4.1/datashape/tests/test_creation.py:        # Make sure it raises exceptions on a few nonsense inputs
/mnt/gen2/TmpDir/portage/dev-python/datashape-0.4.1/work/datashape-0.4.1/datashape/tests/test_discovery.py:from datashape.internal_utils import raises

The raises func from datashape-0.4.1/datashape/internal_utils.py was the first I saw and tried and worked. Now I see there is another,

datashape-0.4.1/datashape/py2help.py: raises = pytest.raises

Let's forget about

add from datashape.internal_utils import raises to datashape/tests/test_coretypes.py sees it pass

and concentrate on

E NameError: global name 'raises' is not defined

mrocklin commented 9 years ago

Right. So this has already been fixed in master. Nothing remains to be done except wait until the next release.

idella commented 9 years ago

ah ok that's fine then. Actually on re-reading I didn't register assert pytest.raises(..... So it happens that you released, found the missed 'raises' and fixed it before I acquired the release of -0.4.1. I get it now