Use sys module to establish a test environment