Skip to content

Commit a770890

Browse files
committed
tests: Remove tox assert
Allow running tests without tox, so remove the check for a tox environment. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent e6437d3 commit a770890

File tree

9 files changed

+2
-20
lines changed

9 files changed

+2
-20
lines changed

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ def _check_git_capabilities(tmpdir_factory):
8787
pass
8888

8989
@pytest.fixture(scope='session')
90-
def _session_repos():
90+
def _session_repos(tmp_path_factory):
9191
'''Just a helper, do not use directly.'''
9292

9393
# It saves time to create repositories once at session scope, then
9494
# clone the results as needed in per-test fixtures.
95-
session_repos = os.path.join(os.environ['TOXTEMPDIR'], 'session_repos')
95+
session_repos = str(tmp_path_factory.mktemp('session_repos'))
9696
print('initializing session repositories in', session_repos)
9797
shutil.rmtree(session_repos, ignore_errors=True)
9898

tests/test_alias.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
import os
65
import subprocess
76

87
import pytest
98
from conftest import cmd
109

11-
assert 'TOXTEMPDIR' in os.environ, "you must run these tests using tox"
12-
1310

1411
@pytest.fixture(autouse=True)
1512
def autouse_tmpdir(config_tmpdir, west_init_tmpdir):

tests/test_commands.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
# Copyright (c) 2021, Nordic Semiconductor ASA
22

3-
import os
4-
53
import pytest
64

75
from west.commands import Verbosity, WestCommand
86

9-
assert 'TOXTEMPDIR' in os.environ, "you must run these tests using tox"
10-
117
gv = WestCommand._parse_git_version
128

139

tests/test_config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from west import configuration as config
1515
from west.util import PathType
1616

17-
assert 'TOXTEMPDIR' in os.environ, "you must run these tests using tox"
18-
1917
SYSTEM = config.ConfigFile.SYSTEM
2018
GLOBAL = config.ConfigFile.GLOBAL
2119
LOCAL = config.ConfigFile.LOCAL

tests/test_help.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from west.app.main import BUILTIN_COMMAND_GROUPS
1010

11-
assert 'TOXTEMPDIR' in os.environ, "you must run these tests using tox"
1211

1312
def test_builtin_help_and_dash_h(west_init_tmpdir):
1413
# Test "west help" and "west -h" are the same for built-in

tests/test_main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import os
21
import subprocess
32
import sys
43

54
import west.version
65

7-
assert 'TOXTEMPDIR' in os.environ, "you must run these tests using tox"
86

97
def test_main():
108
# A quick check that the package can be executed as a module which

tests/test_manifest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
validate,
5454
)
5555

56-
assert 'TOXTEMPDIR' in os.environ, "you must run these tests using tox"
57-
5856
FPI = ImportFlag.FORCE_PROJECTS # to force project imports to use the callback
5957

6058
if platform.system() == 'Windows':

tests/test_project.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
from west.manifest import ImportFlag as MIF
2929
from west.manifest import Manifest, ManifestImportFailed, ManifestProject, Project
3030

31-
assert 'TOXTEMPDIR' in os.environ, "you must run these tests using tox"
32-
3331
#
3432
# Helpers
3533
#

tests/test_project_caching.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
rev_parse,
1919
)
2020

21-
assert 'TOXTEMPDIR' in os.environ, "you must run these tests using tox"
22-
2321
#
2422
# Helpers
2523
#

0 commit comments

Comments
 (0)