New GitHub issue #119048 from frenzymadness:<br>

<hr>

<pre>
# Bug report

### Bug description:

When switching from `os.listdir` to `os.scandir` [7 years ago](https://github.com/python/cpython/commit/d4d79bc1ff91b04625c312f0219c89aabcd19ce4) somebody forgot to update the definition of _use_fd_functions in `test_shutil` together with `shutil` module.

in shutil:
```
_use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} <=
                     os.supports_dir_fd and
 os.scandir in os.supports_fd and
                     os.stat in os.supports_follow_symlinks)
```

in test_shutil:
```
 _use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} <=
 os.supports_dir_fd and
 os.listdir in os.supports_fd and
                             os.stat in os.supports_follow_symlinks)
```

I believe there is no need to calculate this variable twice so I'm gonna propose a PR where I use the value from shutil.py in its tests. Nobody will ever forget to update both places again.

### CPython versions tested on:

CPython main branch

### Operating systems tested on:

_No response_
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/119048">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>