Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the previous patches we were attempting to use unittest.mock.patch.dict to override the env variable used to control parallel execution in qiskit. However, the issue with doing this is that the env variable is read at import time and stored in a global variable as we don't expect the env variable to change dynamically during the execution of a script. To workaround this the mocks are removed and instead a setUp() method is added to the test class to override the whatever the environment default is and instead hardcode parallel_map to run in parallel for the test and then switch it back to the earlier value after the test finishes. This lets us dynamically adjust the default behavior for parallel execution for this test class.
- Loading branch information