Skip to content

Commit 8fb73cd

Browse files
authored
Merge pull request #4 from CCExtractor/fix/test-env-isolation
Drop SP_BASE_URL and SP_API_TOKEN from the test environment
2 parents faf012c + 1f37938 commit 8fb73cd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,11 @@
3636
os.environ['HOME'] = os.path.join(SESSION_SANDBOX, 'home')
3737
os.makedirs(os.environ['HOME'], exist_ok=True)
3838

39+
# The CLI reads these through click's envvar= (see main.py), so a developer with
40+
# either exported -- which is exactly what the README suggests for day-to-day use
41+
# -- changes what the tests observe. SP_BASE_URL made a precedence test fail; a
42+
# real SP_API_TOKEN would quietly become test input. Drop both.
43+
for _leaking in ('SP_BASE_URL', 'SP_API_TOKEN'):
44+
os.environ.pop(_leaking, None)
45+
3946
atexit.register(shutil.rmtree, SESSION_SANDBOX, True)

0 commit comments

Comments
 (0)