

def test_wait_for_code_changes(self):
    result = []
    (r, w) = os.pipe()
    pid = os.fork()
    if pid:
        os.close(w)
        sleep(1)
        self.f.write('something')
        self.f.flush()
        sleep(1)
        r = os.fdopen(r)
        self.assertEqual('Changes in file "temp_dir/tempfile"', r.read())
        os.kill(w, signal.SIGKILL)
        os.waitpid(pid, 0)
    else:
        os.close(r)
        w = os.fdopen(w, 'w')

        def writeback_and_stop(message, filename, *args, **kwargs):
            w.write((message % filename))
            w.close()
        Logger.info = Mock(side_effect=writeback_and_stop)
        app.wait_for_code_change(extra_files=('temp_dir/nonexistent', 'temp_dir/tempfile'))
        os._exit(0)

dataset/ETHPy150Open SmartTeleMax/iktomi/tests/cli/app.py WaitForChangeTest.test_wait_for_code_changes/VarMisuse@100/124 `pid`->`w`