(self)
| 1996 | |
| 1997 | @threading_helper.requires_working_threading() |
| 1998 | def test_lru_cache_threaded3(self): |
| 1999 | @self.module.lru_cache(maxsize=2) |
| 2000 | def f(x): |
| 2001 | time.sleep(.01) |
| 2002 | return 3 * x |
| 2003 | def test(i, x): |
| 2004 | self.assertEqual(f(x), 3 * x, i) |
| 2005 | threads = [threading.Thread(target=test, args=(i, v)) |
| 2006 | for i, v in enumerate([1, 2, 2, 3, 2])] |
| 2007 | with threading_helper.start_threads(threads): |
| 2008 | pass |
| 2009 | |
| 2010 | def test_need_for_rlock(self): |
| 2011 | # This will deadlock on an LRU cache that uses a regular lock |
nothing calls this directly
no test coverage detected