Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the object_type return value for the None case #2073

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

kounelisagis
Copy link
Member

Following the changes in #2049, object_type now returns the string 'None' instead of the <class 'NoneType'> object. This PR fixes the issue and adds a new test for this case.

The output of the new test with the old object_type method:

=========================================================================== test session starts ============================================================================
platform darwin -- Python 3.11.9, pytest-8.3.1, pluggy-1.5.0
rootdir: /Users/agis/TileDB_workspace/TileDB-Py
configfile: pyproject.toml
plugins: hypothesis-6.108.4
collected 6 items / 5 deselected / 1 selected                                                                                                                              

tiledb/tests/test_util.py::UtilTest::test_object_type FAILED                                                                                                         [100%]

================================================================================= FAILURES =================================================================================
________________________________________________________________________ UtilTest.test_object_type _________________________________________________________________________

self = <tiledb.tests.test_util.UtilTest object at 0x106c8c650>

    def test_object_type(self):
        uri = self.path("test_object_type")
    
        # None case
>       self.assertIsNone(tiledb.object_type(uri))

tiledb/tests/test_util.py:173: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../anaconda3/envs/py11tiledb/lib/python3.11/contextlib.py:301: in helper
    return _GeneratorContextManager(func, args, kwds)
../../anaconda3/envs/py11tiledb/lib/python3.11/contextlib.py:105: in __init__
    self.gen = func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tiledb.tests.test_util.UtilTest object at 0x106c8c650>, a1 = 'None'

    @contextlib.contextmanager
    def assertIsNone(self, a1):
>       assert a1 is None
E       AssertionError

tiledb/tests/common.py:183: AssertionError
========================================================================= short test summary info ==========================================================================
FAILED tiledb/tests/test_util.py::UtilTest::test_object_type - AssertionError
===================================================================== 1 failed, 5 deselected in 0.17s ======================================================================

[sc-55930]

@ihnorton ihnorton merged commit f057c52 into dev Sep 25, 2024
33 checks passed
@ihnorton ihnorton deleted the agis/fix-object-type-return-value branch September 25, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants