Skip to content

Test_FullFeatureTreesTest.test2_full_featured_tree2_test fails #18

Description

@yurivict
=========================================================================================================== FAILURES ===========================================================================================================
___________________________________________________________________________________ Test_FullFeatureTreesTest.test2_full_featured_tree2_test ___________________________________________________________________________________

self = <test_itertree_full_feature_trees.Test_FullFeatureTreesTest object at 0x1366064610>

    def test2_full_featured_tree2_test(self):
        print('\nRUN OF TEST: full featured iTree 2 (linked)')
    
        # we create 2 deep items load the link in second level of both trees
        print('Current recursion limit is: %s' % sys.getrecursionlimit())
        depth = sys.getrecursionlimit() - 100
        root_data_path = get_relpath_to_root('tmp')
        print('Temporary files stored in %s'%root_data_path)
        target_path = root_data_path + '/out.itr'
        assert os.path.exists(target_path), 'We need resulting file of test1 for this test, related file not found'
        target_path2 = root_data_path + '/out2.itr'
    
        root=iTree('root')
        p1=root.append(iTree('part1'))
        sub=p1
        for i in range(depth):
            # serializer cannot handle deeper trees at the moment
            sub = sub.append(iTree(i, i))
    
        p2=root.append(iTree('part2'))
        sub=p2
        for i in range(depth):
            # serializer cannot handle deeper trees at the moment
            sub = sub.append(iTree((i,i), i))
    
        print('The build iTree has a depth of %i' % (depth+1))
    
        #create the link elements:
        link1=p1.append(iTree('link1',link=iTLink(target_path)))
        p1.append(iTree('after item'))
        link2=p2.append(iTree('link2', link=iTLink(target_path, ['root'])))
        p2.append(iTree('after item'))
        assert Tag('after item') not in p2
        a=len(root.deep)
    
        root.load_links()
        #insert some locals
        link1.insert(0, iTree('local', 0))
        link1.insert(1,iTree('local',1))
        link1.insert(2, iTree('local',2))
        link1.insert(-1, iTree('local', 3))
    
        link2.insert(0, iTree('local', 0))
        link2.insert(1,iTree('local',1))
        link2.insert(2, iTree('local',2))
        link2.insert(-1, iTree('local', 3))
        s=len(root.deep)
        b=link2[3]
        assert link2[3].is_linked
        s2=len(link2[3].deep)
        link2[3].make_local()
        assert not link2[3].is_linked
        assert s2==len(link2[3].deep)
        assert link2[4].is_linked
        link2[4].make_local()
        assert not link2[4].is_linked
        assert len(root.deep) == s
    
        n=len(iTree().load(target_path).deep)
        print('Exec time number of all items: %f s:' % calc_timeit(root.deep.__len__, 10))
        print('iTree size before load: %i'%a)
        print('iTree size of linked items: %i' % (2*n))
        assert len(root.deep) == a + 2 * n + 8 # 8 locals added
        print('iTree size after load links: %i -> checked: ok' % (2 * n+a+8))
        #assert root.tree.filtered_len(filter_method=lambda i: i.is_value_read_only, hierarcical=False) == 12
        #assert root.tree.filtered_len(filter_method=lambda i: i.is_tree_read_only, hierarcical=False) == 18
        #assert root.tree.filtered_len(filter_method=lambda i: i.is_value_read_only, hierarcical=False) == 12
        print('Exec time max_depth(): %f s:' % calc_timeit(lambda: root.max_depth, 10))
        print('iTree max_depth: %i' % root.max_depth)
>       assert root.max_depth==902
E       AssertionError: assert 901 == 902
E        +  where 901 = iTree('root', subtree=[iTree('part1', subtree=[iTree(0, value=0, subtree=[iTree(1, value=1, subtree=[iTree(2, value=2, subtree=[iTree(3, value=3, subtree=[iTree(4, value=4, subtree=[iTree(5, value=5, subtree=[iTree(6, value=6, subtree=[iTree(7, value=7, subtree=[iTree(8, value=8, subtree=[iTree(9, value=9, subtree=[iTree(10, value=10, subtree=[iTree(11, value=11, subtree=[iTree(12, value=12, subtree=[iTree(13, value=13, subtree=[iTree(14, value=14, subtree=[iTree(15, value=15, subtree=[iTree(16, value=16, subtree=[iTree(17, value=17, subtree=[iTree(18, value=18, subtree=[iTree(19, value=19, subtree=[iTree(20, value=20, subtree=[iTree(21, value=21, subtree=[iTree(22, value=22, subtree=[iTree(23, value=23, subtree=[iTree(24, value=24, subtree=[iTree(25, value=25, subtree=[iTree(26, value=26, subtree=[iTree(27, value=27, subtree=[iTree(28, value=28, subtree=[iTree(29, value=29, subtree=[iTree(30, value=30, subtree=[iTree(31, value=31, subtree=[iTree(32, value=32, subtree=[iTree(33, value=33, subtree=[iTree(34, value=34, subtree=[iTree(35, value=35, subtree=[iTree(36, value=36, subtree=[iTree(37, value=37, subtree=[iTree(38, value=38, subtree=[iTree(39, value=39, subtree=[iTree(40, v...n83'}, flags=0b1000), iTree('sub4_n', value={'level': 'n84'}, flags=0b1000), iTree('sub4_n', value={'level': 'n85'}, flags=0b1000), iTree('sub4_n', value={'level': 'n86'}, flags=0b1000), iTree('sub4_n', value={'level': 'n87'}, flags=0b1000), iTree('sub4_n', value={'level': 'n88'}, flags=0b1000), iTree('sub4_n', value={'level': 'n89'}, flags=0b1000), iTree('sub4_n', value={'level': 'n90'}, flags=0b1000), iTree('sub4_n', value={'level': 'n91'}, flags=0b1000), iTree('sub4_n', value={'level': 'n92'}, flags=0b1000), iTree('sub4_n', value={'level': 'n93'}, flags=0b1000), iTree('sub4_n', value={'level': 'n94'}, flags=0b1000), iTree('sub4_n', value={'level': 'n95'}, flags=0b1000), iTree('sub4_n', value={'level': 'n96'}, flags=0b1000), iTree('sub4_n', value={'level': 'n97'}, flags=0b1000), iTree('sub4_n', value={'level': 'n98'}, flags=0b1000), iTree('sub4_n', value={'level': 'n99'}, flags=0b1000)], flags=0b1000), iTree('NUMPY', value={'myarray': array([  1.5,   4. ,   3.6, 467. ])}, flags=0b1000), iTree('local', value=3), iTree('OD', value={'od': OrderedDict([('C', 'c'), ('A', 'a'), ('B', 'b')])}, flags=0b1000)], link=iTLink('tests/tmp/out.itr',[]), flags=0b100100), iTree('after item')])]).max_depth

tests/test_itertree_full_feature_trees.py:328: AssertionError
----------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------

RUN OF TEST: full featured iTree 2 (linked)
Current recursion limit is: 1000
Temporary files stored in /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/tests/tmp
The build iTree has a depth of 901
Exec time number of all items: 0.001481 s:
iTree size before load: 1806
iTree size of linked items: 238
iTree size after load links: 2052 -> checked: ok
Exec time max_depth(): 0.003707 s:
iTree max_depth: 901
======================================================================================================= warnings summary =======================================================================================================
src/itertree/itree_mathsets.py:580
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/itree_mathsets.py:580: DeprecationWarning: invalid escape sequence \F
    """

src/itertree/itree_mathsets.py:1469
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/itree_mathsets.py:1469: DeprecationWarning: invalid escape sequence \F
    """

src/itertree/itree_mathsets.py:1755
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/itree_mathsets.py:1755: DeprecationWarning: invalid escape sequence \F
    """

src/itertree/itree_mathsets.py:2109
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/itree_mathsets.py:2109: DeprecationWarning: invalid escape sequence \F
    """

src/itertree/itree_serializer/itree_render_dot.py:107
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/itree_serializer/itree_render_dot.py:107: DeprecationWarning: invalid escape sequence \{
    item_str=item_str.replace('{','\{').replace('}','\}')

src/itertree/itree_serializer/itree_render_dot.py:107
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/itree_serializer/itree_render_dot.py:107: DeprecationWarning: invalid escape sequence \}
    item_str=item_str.replace('{','\{').replace('}','\}')

src/itertree/examples/performance_analysis/test_append.py:5
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_append.py:5: PytestCollectionWarning: cannot collect test class 'TestBuildByAppendL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_append.py)
    class TestBuildByAppendL1(BasePerformance):

src/itertree/examples/performance_analysis/test_append.py:129
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_append.py:129: PytestCollectionWarning: cannot collect test class 'TestBuildByAppendLn' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_append.py)
    class TestBuildByAppendLn(BasePerformance):

src/itertree/examples/performance_analysis/test_compare.py:6
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_compare.py:6: PytestCollectionWarning: cannot collect test class 'TestCompareL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_compare.py)
    class TestCompareL1(BasePerformance):

src/itertree/examples/performance_analysis/test_copy.py:7
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_copy.py:7: PytestCollectionWarning: cannot collect test class 'TestCopyL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_copy.py)
    class TestCopyL1(BasePerformance):

src/itertree/examples/performance_analysis/test_copy.py:257
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_copy.py:257: PytestCollectionWarning: cannot collect test class 'TestCopyLn' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_copy.py)
    class TestCopyLn(BasePerformance):

src/itertree/examples/performance_analysis/test_delete.py:7
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_delete.py:7: PytestCollectionWarning: cannot collect test class 'TestDeleteL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_delete.py)
    class TestDeleteL1(BasePerformance):

src/itertree/examples/performance_analysis/test_delete.py:187
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_delete.py:187: PytestCollectionWarning: cannot collect test class 'TestGetByIdxLn' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_delete.py)
    class TestGetByIdxLn(BasePerformance):

src/itertree/examples/performance_analysis/test_extend.py:5
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_extend.py:5: PytestCollectionWarning: cannot collect test class 'TestBuildByExtendL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_extend.py)
    class TestBuildByExtendL1(BasePerformance):

src/itertree/examples/performance_analysis/test_get_by_idx.py:6
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_get_by_idx.py:6: PytestCollectionWarning: cannot collect test class 'TestGetByIdxL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_get_by_idx.py)
    class TestGetByIdxL1(BasePerformance):

src/itertree/examples/performance_analysis/test_get_by_idx.py:198
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_get_by_idx.py:198: PytestCollectionWarning: cannot collect test class 'TestGetByIdxLn' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_get_by_idx.py)
    class TestGetByIdxLn(BasePerformance):

src/itertree/examples/performance_analysis/test_get_by_idx_slice.py:6
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_get_by_idx_slice.py:6: PytestCollectionWarning: cannot collect test class 'TestGetByIdxSliceL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_get_by_idx_slice.py)
    class TestGetByIdxSliceL1(BasePerformance):

src/itertree/examples/performance_analysis/test_get_by_key.py:6
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_get_by_key.py:6: PytestCollectionWarning: cannot collect test class 'TestGetByKeyL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_get_by_key.py)
    class TestGetByKeyL1(BasePerformance):

src/itertree/examples/performance_analysis/test_get_by_key.py:256
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_get_by_key.py:256: PytestCollectionWarning: cannot collect test class 'TestGetByKeyLn' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_get_by_key.py)
    class TestGetByKeyLn(BasePerformance):

src/itertree/examples/performance_analysis/test_insert.py:5
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_insert.py:5: PytestCollectionWarning: cannot collect test class 'TestBuildByInsertL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_insert.py)
    class TestBuildByInsertL1(BasePerformance):

src/itertree/examples/performance_analysis/test_iter.py:6
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_iter.py:6: PytestCollectionWarning: cannot collect test class 'TestIterL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_iter.py)
    class TestIterL1(BasePerformance):

src/itertree/examples/performance_analysis/test_iter.py:92
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_iter.py:92: PytestCollectionWarning: cannot collect test class 'TestIterLn' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_iter.py)
    class TestIterLn(BasePerformance):

src/itertree/examples/performance_analysis/test_itree_specific.py:9
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_itree_specific.py:9: PytestCollectionWarning: cannot collect test class 'TestiTreeSpecificL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_itree_specific.py)
    class TestiTreeSpecificL1(BasePerformance):

src/itertree/examples/performance_analysis/test_itree_specific.py:261
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_itree_specific.py:261: PytestCollectionWarning: cannot collect test class 'TestiTreeSpecificLn' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_itree_specific.py)
    class TestiTreeSpecificLn(BasePerformance):

src/itertree/examples/performance_analysis/test_save_load.py:8
  /usr/ports/devel/py-itertree/work-py39/itertree-1.0.1/src/itertree/examples/performance_analysis/test_save_load.py:8: PytestCollectionWarning: cannot collect test class 'TestSaveLoadL1' because it has a __init__ constructor (from: src/itertree/examples/performance_analysis/test_save_load.py)
    class TestSaveLoadL1(BasePerformance):

../../../../../local/lib/python3.9/site-packages/pytest_cov/plugin.py:115
  /usr/local/lib/python3.9/site-packages/pytest_cov/plugin.py:115: PytestDeprecationWarning: The hookimpl pytest_load_initial_conftests uses old-style configuration options (marks or attributes).
  Please use the pytest.hookimpl(tryfirst=True) decorator instead
   to configure the hooks.
   See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers
    @pytest.mark.tryfirst

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================== 1 failed, 179 passed, 1 xpassed, 26 warnings in 694.95s (0:11:34) ===============================================================================

Version: 1.0.1
Python-3.9
FreeBSD 13.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions