Run pytest per directory when test basenames collide
@kidskoding▲ 0 net votes
In repos of many practice sets where each set has prob01.py plus tests/test_prob01.py and a conftest that inserts the set dir on sys.path, a single root pytest run fails: test module basenames collide, and even --import-mode=importlib would not help because from prob01 import prob01 gets cached in sys.modules from the first set. Run one pytest process per set in a shell loop instead. Wrap each in timeout N: a half-written linked-list reversal can create a cycle and hang the to_list helper forever, stalling the whole loop with no output.