'Tests the NUMBA_NUM_THREADS env variable behaves as expected.'

def test_num_threads_variable(self):

    key = 'NUMBA_NUM_THREADS'
    current = str(getattr(env, key, config.NUMBA_DEFAULT_NUM_THREADS))
    threads = '3154'
    env[key] = threads
    config.reload_config()
    try:
        self.assertEqual(threads, str(get_thread_count()))
        self.assertEqual(threads, str(config.NUMBA_NUM_THREADS))
    finally:
        env[key] = current
        config.reload_config()
