

def test_race(self):
    path = os.path.join(stderr.temp, 'afile')
    open(path, mode='w').close()

    @modifiers.annotate(afile=converters.file(mode='w'))
    def func(afile):
        os.chmod(path, stat.S_IRUSR)
        with afile:
            raise NotImplementedError
    (stdout, stderr) = self.crun(func, ['test', path])
    self.assertFalse(stdout.getvalue())
    self.assertTrue(stderr.getvalue().startswith('test: Permission denied: '))

dataset/ETHPy150Open epsy/clize/clize/tests/test_converters.py FileConverterTests.test_race/VarMisuse@18/20 `self`->`stderr`