def test_open_nonexistent(self):

        try:
            fits.open(self.temp('foobar.fits'))
        except IOError as exc:
            assert 'No such file or directory' in str(exc)
        except:
            raise

        # But opening in ostream or append mode should be okay, since they
        # allow writing new files
        for mode in ('ostream', 'append'):
            with fits.open(self.temp('foobar.fits'), mode=mode) as h:
                pass

            assert os.path.exists(self.temp('foobar.fits'))
            os.remove(self.temp('foobar.fits'))
Test the creation of a simple XlsxWriter file.
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/tests/test_core.py/TestFileFunctions.test_open_nonexistent--crossover with--dataset/ETHPy150Open jmcnamara/XlsxWriter/xlsxwriter/test/comparison/test_default_format01.py/TestCompareXLSXFiles.test_create_file