From 67ca1902a095e9839d21e4a11f3015183102ab39 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 5 Feb 2021 09:42:01 +0530 Subject: [PATCH] Use a cache dir in the cwd on CI --- kitty_tests/__init__.py | 2 ++ kitty_tests/graphics.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kitty_tests/__init__.py b/kitty_tests/__init__.py index 7d42954d2..7e8eedb2b 100644 --- a/kitty_tests/__init__.py +++ b/kitty_tests/__init__.py @@ -2,6 +2,7 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +import os from unittest import TestCase from kitty.config import Options, defaults, merge_configs @@ -81,6 +82,7 @@ class BaseTest(TestCase): ae = TestCase.assertEqual maxDiff = 2000 + is_ci = os.environ.get('CI') == 'true' def set_options(self, options=None): final_options = {'scrollback_pager_history_size': 1024, 'click_interval': 0.5} diff --git a/kitty_tests/graphics.py b/kitty_tests/graphics.py index 014debc4d..7be024c01 100644 --- a/kitty_tests/graphics.py +++ b/kitty_tests/graphics.py @@ -180,10 +180,10 @@ def make_send_command(screen): class TestGraphics(BaseTest): def setUp(self): - self.cache_dir = cache_dir.override_dir = tempfile.mkdtemp() + cache_dir.override_dir = tempfile.mkdtemp(dir=os.getcwd() if self.is_ci else None) def tearDown(self): - os.rmdir(self.cache_dir) + os.rmdir(cache_dir.override_dir) cache_dir.override_dir = None def test_xor_data(self):