diff options
| author | Eric N. Vander Weele <ericvw@gmail.com> | 2019-12-29 18:40:09 -0500 |
|---|---|---|
| committer | Eric N. Vander Weele <ericvw@gmail.com> | 2019-12-29 19:17:31 -0500 |
| commit | 738c8490ec56fc364f4229df2c7c9adca8d1d4f2 (patch) | |
| tree | be8cf25e4c6514ed9c71427c44d34bef6d3f23f3 /tests/integration | |
| parent | 7f9f70064c50bbb6024fafed4568e0693f5640b5 (diff) | |
| download | flake8-738c8490ec56fc364f4229df2c7c9adca8d1d4f2.tar.gz | |
tests: Add integration tests for `--config` and `--isolated`
Prevent regressions by adding integration tests to ensure that these
options are passed through to `aggregator.aggregate_options()`.
Diffstat (limited to 'tests/integration')
| -rw-r--r-- | tests/integration/test_main.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/integration/test_main.py b/tests/integration/test_main.py index f3ace53..42ad76c 100644 --- a/tests/integration/test_main.py +++ b/tests/integration/test_main.py @@ -167,3 +167,31 @@ def test_obtaining_args_from_sys_argv_when_not_explicity_provided(capsys): out, err = capsys.readouterr() assert out.startswith('usage: flake8 [options] file file ...\n') assert err == '' + + +def test_cli_config_option_respected(tmp_path): + """Test --config is used.""" + config = tmp_path / "flake8.ini" + config.write_text(u"""\ +[flake8] +ignore = F401 +""") + + py_file = tmp_path / "t.py" + py_file.write_text(u"import os\n") + + _call_main(["--config", str(config), str(py_file)]) + + +def test_cli_isolated_overrides_config_option(tmp_path): + """Test --isolated overrides --config.""" + config = tmp_path / "flake8.ini" + config.write_text(u"""\ +[flake8] +ignore = F401 +""") + + py_file = tmp_path / "t.py" + py_file.write_text(u"import os\n") + + _call_main(["--isolated", "--config", str(config), str(py_file)], retv=1) |
