Skip to content

Commit

Permalink
Add test capturing expectation that sys.argv need not be initialized …
Browse files Browse the repository at this point in the history
…as indicated by the Python docs and might in fact be empty or uninitialized or not a list. Ref #445.
  • Loading branch information
jaraco committed Aug 22, 2020
1 parent 4340b52 commit 2167d74
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_integration.py
@@ -0,0 +1,19 @@
import sys
import subprocess

import pytest


argv_manipulations = [
'del sys.argv',
'sys.argv = []',
'sys.argv = None',
]


@pytest.mark.xfail(reason="#445")
@pytest.mark.parametrize('argv', argv_manipulations)
def test_argv(argv):
code = f'import sys; {argv}; import keyring'
cmd = [sys.executable, '-c', code]
assert not subprocess.check_output(cmd, stderr=subprocess.STDOUT)

0 comments on commit 2167d74

Please sign in to comment.