def test_task_double_close(self): with pytest.warns(DaqResourceWarning): with nidaqmx.Task() as task: task.close()