def test_log_file_no_directory(): """ Test opening a log file with no directory name. """ from pip.basecommand import open_logfile fp = open_logfile('testpip.log') fp.write('can write') fp.close() assert os.path.exists(fp.name) os.remove(fp.name)