Skip to content

Commit e7efcea

Browse files
authored
test: fix unit tests to not overwrite existing cli config file (#642)
1 parent 4a3f37d commit e7efcea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ clean:
6666
rm -rf dist linode_cli.egg-info build
6767

6868
.PHONY: testunit
69-
testunit: export LINODE_CLI_TEST_MODE = 1
7069
testunit:
71-
pytest -v tests/unit
70+
@mkdir -p /tmp/linode/.config
71+
@orig_xdg_config_home=$${XDG_CONFIG_HOME:-}; \
72+
export LINODE_CLI_TEST_MODE=1 XDG_CONFIG_HOME=/tmp/linode/.config; \
73+
pytest -v tests/unit; \
74+
export XDG_CONFIG_HOME=$$orig_xdg_config_home
7275

7376
.PHONY: testint
7477
testint:

0 commit comments

Comments
 (0)