New submission from Nikita Sobolev <m...@sobolevn.me>:

Right now there are two tests in Lib/test/test_functools.py that use 
`functools.lru_cache` directly:
1. 
https://github.com/python/cpython/blame/73140de97cbeb01bb6c9af1da89ecb9355921e91/Lib/test/test_functools.py#L1417
2. 
https://github.com/python/cpython/blame/73140de97cbeb01bb6c9af1da89ecb9355921e91/Lib/test/test_functools.py#L1429

But, I don't think it is correct. Why?

```python
class TestLRUPy(TestLRU, unittest.TestCase):
    module = py_functools

class TestLRUC(TestLRU, unittest.TestCase):
    module = c_functools
```

Source: 
https://github.com/python/cpython/blame/73140de97cbeb01bb6c9af1da89ecb9355921e91/Lib/test/test_functools.py#L1798-L1823

So, what can we do?

1. Use `self.module.lru_cache` instead (I think it is the right way)
2. Move them to `TestLRUPy`, but I don't think they should be python-specific

----------
components: Tests
messages: 410579
nosy: sobolevn
priority: normal
severity: normal
status: open
title: `test_functools.TestLRU`  must not use `functools` module directly
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46380>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to