diff options
author | say <say@yandex-team.ru> | 2022-05-14 02:04:16 +0300 |
---|---|---|
committer | say <say@yandex-team.ru> | 2022-05-14 02:04:16 +0300 |
commit | 492822761567bdac7f2dbe844de1bb3086e9e28e (patch) | |
tree | 5b527a1555338279656fb67212cdcfc3c37bfc49 /library/python/runtime_py3/test | |
parent | e5ffe7fe05e7f9d1fd1825a902f5bbbed331d817 (diff) | |
download | ydb-492822761567bdac7f2dbe844de1bb3086e9e28e.tar.gz |
YMAKE-144: Fix RuntimeError: dictionary changed size during iteration
ref:919db9913468e91d031bbd511beeacdcfdd74489
Diffstat (limited to 'library/python/runtime_py3/test')
-rw-r--r-- | library/python/runtime_py3/test/test_arcadia_source_finder.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/library/python/runtime_py3/test/test_arcadia_source_finder.py b/library/python/runtime_py3/test/test_arcadia_source_finder.py index ff80d0a0a2..c01435f7df 100644 --- a/library/python/runtime_py3/test/test_arcadia_source_finder.py +++ b/library/python/runtime_py3/test/test_arcadia_source_finder.py @@ -315,3 +315,27 @@ class TestEmptyResources(ArcadiaSourceFinderTestCase): def test_iter_modules(self): assert [] == list(self.arcadia_source_finder.iter_modules('', 'PFX.')) + + +class TestDictionaryChangedSizeDuringIteration(ArcadiaSourceFinderTestCase): + def _get_mock_fs(self): + return ''' + home: + arcadia: + project: + lib1: + mod1.py: '' + lib2: + mod2.py: '' + ''' + + def _get_mock_resources(self): + return { + b'py/namespace/unique_prefix1/project/lib1': b'project.lib1.', + b'py/namespace/unique_prefix1/project/lib2': b'project.lib2.', + } + + def test_no_crash_on_recusive_iter_modules(self): + for package in self.arcadia_source_finder.iter_modules('project.', ''): + for _ in self.arcadia_source_finder.iter_modules(package[0], ''): + pass |