File tree 1 file changed +3
-15
lines changed
1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change 2
2
# SPDX-FileCopyrightText: 2021 Filipe Laíns <[email protected] >
3
3
4
4
import contextlib
5
- import importlib .util
6
5
import os
7
6
import os .path
8
7
import unittest .mock
11
10
import pytest
12
11
import testsuite
13
12
13
+ import build_system
14
+
14
15
15
16
root_dir = os .path .abspath (os .path .join (__file__ , '..' , '..' ))
16
17
@@ -25,15 +26,6 @@ def cd(*path_paths):
25
26
os .chdir (old_cwd )
26
27
27
28
28
- def import_file (name , path ):
29
- spec = importlib .util .spec_from_file_location (name , path )
30
- if not spec .loader :
31
- raise ImportError (f'Unable to import `{ path } `: no loader' )
32
- module = importlib .util .module_from_spec (spec )
33
- spec .loader .exec_module (module ) # type: ignore
34
- return module
35
-
36
-
37
29
@pytest .fixture ()
38
30
def device (request ):
39
31
return testsuite .Device (
@@ -59,8 +51,4 @@ def basic_device():
59
51
60
52
@pytest .fixture ()
61
53
def fw_version ():
62
- with cd (root_dir ):
63
- configure = import_file ('configure' , 'configure.py' )
64
- version = configure .BuildSystemBuilder .calculate_version ()
65
- is_dirty = configure .BuildSystemBuilder ._is_git_dirty ()
66
- return f'{ version } .dirty' if is_dirty else version
54
+ return build_system .VersionInfo .from_git ().full_string
You can’t perform that action at this time.
0 commit comments