summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_free_threading/test_pwd.py
blob: 58ab22bae3967311300b644381a3293ce965cccc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import unittest

from test.support import threading_helper
from test.support.threading_helper import run_concurrently

from test import test_pwd


NTHREADS = 10


@threading_helper.requires_working_threading()
class TestPwd(unittest.TestCase):
    def setUp(self):
        self.test_pwd = test_pwd.PwdTest()

    def test_racing_test_values(self):
        # test_pwd.test_values() calls pwd.getpwall() and checks the entries
        run_concurrently(
            worker_func=self.test_pwd.test_values, nthreads=NTHREADS
        )

    def test_racing_test_values_extended(self):
        # test_pwd.test_values_extended() calls pwd.getpwall(), pwd.getpwnam(),
        # pwd.getpwduid() and checks the entries
        run_concurrently(
            worker_func=self.test_pwd.test_values_extended,
            nthreads=NTHREADS,
        )


if __name__ == "__main__":
    unittest.main()