From: Michael Fladischer <FladischerMichael@fladi.at>
Date: Wed, 25 Nov 2020 23:11:08 +0100
Subject: Use tempfile module to create output file in tests.

---
 crontab.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/crontab.py b/crontab.py
index ae258b9..adea392 100644
--- a/crontab.py
+++ b/crontab.py
@@ -18,6 +18,7 @@
 """
 from crontab import CronTab
 import sys
+import tempfile
 
 # Create a new non-installed crontab
 cron = CronTab(tab='')
@@ -68,7 +69,8 @@ output = cron.render()
 
 cron.write()
 
-cron.write(filename='/tmp/output.txt')
+with tempfile.NamedTemporaryFile() as fp:
+    cron.write(filename=fp.name)
 
 #cron.write_to_user(user=True)
 
