summaryrefslogtreecommitdiff
path: root/sys-apps/pkgcore/files/pkgcore-0.12.17-fix-extra-files.patch
blob: bc6b16ffc69fbe81d1987f81cf903d15cecf86fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- a/tests/ebuild/test_eapi.py
+++ b/tests/ebuild/test_eapi.py
@@ -1,6 +1,8 @@
+import shutil
 from unittest import mock
 
 import pytest
+from pkgcore.const import EBD_PATH
 from pkgcore.ebuild import eapi
 from pkgcore.ebuild.eapi import EAPI, eapi6, get_eapi
 
@@ -19,13 +21,15 @@ def test_get_eapi():
 
 class TestEAPI:
 
-    def test_register(self):
+    def test_register(self, tmp_path):
         # re-register known EAPI
         with pytest.raises(ValueError):
             EAPI.register(magic="0")
 
+        mock_ebd_temp = str(shutil.copytree(EBD_PATH, tmp_path / 'ebd'))
         with mock.patch('pkgcore.ebuild.eapi.bash_version') as bash_version, \
-                mock.patch.dict(eapi.EAPI.known_eapis):
+                mock.patch.dict(eapi.EAPI.known_eapis), \
+                mock.patch('pkgcore.ebuild.eapi.const.EBD_PATH', mock_ebd_temp):
             # inadequate bash version
             bash_version.return_value = '3.1'
             with pytest.raises(SystemExit) as excinfo: