from pymol2 import SingletonPyMOL
import os
from os.path import isfile, join

PNG_NAME = join(os.sep, "tmp", "pymol_test.png")

pymol = SingletonPyMOL()
pymol.start()
cmd = pymol.cmd

cmd.load("1aki.cif")
cmd.png(PNG_NAME, ray=1)

assert isfile(PNG_NAME)
@@ -1,111 +1,125 @@
-from pymol2 import SingletonPyMOL%0Aimport os%0Afrom os.path import isfile, join%0A%0APNG_NAME = join(os.sep, %22tmp%22
+import tempfile%0Afrom os.path import isfile, join%0Afrom pymol2 import SingletonPyMOL%0A%0APNG_NAME = join(tempfile.gettempdir()
 , %22p

Fix test for Windows