Deep & Minimal Drum and Bass Mix #1
Deep & Minimal Drum and Bass Mix #1
Deep & Minimal Drum and Bass Mix #1
Deep & Minimal Drum and Bass Mix #1
Tokyo Night themed NixOS setup
Pixel Launcher now lets you switch search providers in EU
My first ergo and custom keyboard - Sofle Choc V3
My first ergo and custom keyboard - Sofle Choc V3
Affordable MacBook for building a Flutter application
Tropical summer setup
Cozy station where I code for fun and profit
Since you have all your
shutil.copytrees andsys.pathmanipulation at the top level of the test modules, they are executed the moment those modules are imported.unittestlikely imports all discovered test modules before actually executing the tests so the set up of both modules is executed in random order before the tests are run. The correct way to perform test setup is usingsetUpandsetUpClassmethods ofunittest.TestCase. Their counterpartstearDownandtearDownClassare used to clean up after tests. You probably will be able to get this to work somehow using those methods.However, I'm fairly certain that this entire question is an example of the XY problem and you should be approaching this whole thing differently. Copying the modules and their mock dependencies into a temporary directory and manipulating
sys.pathseems like an absolute nightmare and it will be a massive PITA even if you get it to a working state. I don't know what problem exactly you're trying to solve but I think you should really read up onunittest.mockand even more importantly on dependency injection.