def test_file_from_empty_string_dir(self):
    file_path = '_temp.py'
    with open(file_path, 'w') as file:
        file.write('# test file for importlib')
    try:
        with util.uncache('_temp'):
            loader = self.machinery.SourceFileLoader('_temp', file_path)
            with warnings.catch_warnings():
                warnings.simplefilter('ignore', DeprecationWarning)
                mod = loader.load_module('_temp')
            self.assertEqual(file_path, mod.__file__)
            self.assertEqual(self.util.cache_from_source(file_path), mod.__cached__)
    finally:
        os.unlink(file_path)
        pycache = os.path.dirname(self.util.cache_from_source(file_path))
        if os.path.exists(pycache):
            shutil.rmtree(pycache)
def test_file_from_empty_string_dir(self):
    file_path = '_temp.py'
    with open(file_path, 'w') as file:
        file.write('# test file for importlib')
    try:
        with util.uncache('_temp'):
            loader = self.machinery.SourceFileLoader('_temp', file_path)
            with warnings.catch_warnings():
                warnings.simplefilter('ignore', DeprecationWarning)
                mod = loader.load_module('_temp')
            self.assertEqual(file_path, mod.__file__)
            self.assertEqual(self.util.cache_from_source(file_path), mod.__cached__)
    finally:
        os.unlink(file_path)
        pycache = os.path.dirname(self.util.cache_from_source(file_path))
        if os.path.exists(pycache):
            shutil.rmtree(pycache)