-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply CustomParser to env arg parsing. Fixes #14.
- Loading branch information
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
import subprocess | ||
import sys | ||
|
||
import pytest | ||
|
||
from . import BaseTestCase | ||
|
||
|
||
class TestCase(BaseTestCase): | ||
@pytest.mark.xfail('platform.system() == "Windows"') | ||
def test_env(self, capfd): | ||
def test_env_dash_i(self, capfd): | ||
self.runcommandline('env -i FOO=bar env') | ||
assert capfd.readouterr().out == 'FOO=bar\n' | ||
|
||
@pytest.mark.xfail('platform.system() == "Windows"') | ||
def test_dash_as_dash_i(self, capfd): | ||
self.runcommandline('env - FOO=bar env') | ||
assert capfd.readouterr().out == 'FOO=bar\n' | ||
|
||
def test_env_simple(self, capfd): | ||
self.runcommandline('env') | ||
assert capfd.readouterr().out | ||
|
||
def test_command_opts(self, capfd): | ||
# invoke Python's help (not env's help) | ||
cmd = ['env', sys.executable, '--help'] | ||
self.runcommandline(subprocess.list2cmdline(cmd)) | ||
assert "-m mod" in capfd.readouterr().out |