Closed idella closed 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
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
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.
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
Right. So this has already been fixed in master. Nothing remains to be done except wait until the next release.
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
add from datashape.internal_utils import raises to datashape/tests/test_coretypes.py sees it pass