Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /avinash-mall_CognitiveMemoryLayer /conftest.py
| """Global pytest hooks shared across test trees.""" | |
| from __future__ import annotations | |
| import gc | |
| import sys | |
| import warnings | |
| _SWIG_MODULE_PREFIXES = ( | |
| "sentencepiece", | |
| "tokenizers.implementations.sentencepiece", | |
| ) | |
| def pytest_sessionfinish(session, exitstatus): | |
| """Unload sentencepiece SWIG modules before interpreter teardown. | |
| This avoids a known third-party shutdown deprecation warning: | |
| "builtin type swigvarlink has no __module__ attribute". | |
| """ | |
| removed_any = False | |
| with warnings.catch_warnings(): | |
| warnings.simplefilter("ignore", DeprecationWarning) | |
| for module_name in list(sys.modules): | |
| lower_name = module_name.lower() | |
| if lower_name == "swig_runtime_data4" or any( | |
| lower_name.startswith(prefix) for prefix in _SWIG_MODULE_PREFIXES | |
| ): | |
| sys.modules.pop(module_name, None) | |
| removed_any = True | |
| if removed_any: | |
| gc.collect() | |
Xet Storage Details
- Size:
- 971 Bytes
- Xet hash:
- d3803c6829775eabc3964a1f041553ce3defae9fa809919192e003f7dc68e568
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.