summaryrefslogtreecommitdiff
path: root/tests/integration
Commit message (Collapse)AuthorAgeFilesLines
* test using python3.10Anthony Sottile2021-08-151-2/+6
|
* Handle new SyntaxError tuple on 3.10Ian Stapleton Cordasco2021-08-151-0/+24
| | | | Closes #1372
* Automatically create output directoriesJouke Witteveen2021-05-101-2/+2
|
* short circuit on ast error before tokenization errorAnthony Sottile2021-04-181-2/+14
|
* extend black formatting to tests as wellAnthony Sottile2021-04-186-210/+296
|
* fix mypy errorsAnthony Sottile2021-04-071-0/+4
|
* fix links in codeAnthony Sottile2021-04-031-2/+2
|
* automatic: pyupgrade --py36-plusAnthony Sottile2021-03-304-11/+11
|
* upgrade pycodestyle to 2.7.0Anthony Sottile2021-03-141-2/+1
|
* Merge branch 'no_show_source' into 'master'Anthony Sottile2020-10-021-0/+25
|\ | | | | | | | | Add option to disable show-source for calling tools See merge request pycqa/flake8!441
| * Add option to disable show-source for calling toolsAnthony Sottile2020-06-191-0/+25
| |
* | fix skipping of physical checks when file does not end in newlineAnthony Sottile2020-09-121-0/+31
| |
* | Support linting when missing sem_open syscallNekokatt2020-08-271-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Platforms such as Termux on Android, and other exotic devices do not provide a sem_open implementation on the OS level. This is problematic, as the error resulting from this occurs when calling multiprocessing.Pool, throwing an unhandled ImportError. The issue itself is outlined in https://bugs.python.org/issue3770. This change allows devices missing this system call to respond to the missing feature by falling back to synchronous execution, which appears to be the default behaviour if the multiprocessing module is not found. This change also adds a potential fix for developers working on platforms where multiprocessing itself cannot be imported. The existing code would set the name referencing the import to None, but there are no clear checks to ensure this does not result in an AttributeError later when multiprocessing.Pool has accession attempts. Existing users should see no difference in functionality, as they will assumably already be able to use flake8, so will not be missing this sem_open call. Users on devices without the sem_open call will now be able to use flake8 where they would be unable to before due to unhandled ImportErrors.
* | Tests: Add a value to mocked entry_points, so pytest 6+ can log itMiro HronĨok2020-07-201-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | Pytest 6.0.0rc1 attempts to log a repr of our mocked entry_point, but it fails, becasue the repr metohod expects a valua attribute: Reproducer: $ tox -e py38 --force-dep 'pytest==6.0.0rc1' ... Traceback (most recent call last): File "/usr/lib/python3.8/logging/__init__.py", line 1081, in emit msg = self.format(record) File "/usr/lib/python3.8/logging/__init__.py", line 925, in format return fmt.format(record) File "/usr/lib/python3.8/logging/__init__.py", line 664, in format record.message = record.getMessage() File "/usr/lib/python3.8/logging/__init__.py", line 369, in getMessage msg = msg % self.args File "/tmp/flake8/.tox/py38/lib/python3.8/site-packages/flake8/plugins/manager.py", line 44, in __repr__ self.name, self.entry_point.value File "/tmp/flake8/.tox/py38/lib/python3.8/site-packages/mock/mock.py", line 632, in __getattr__ raise AttributeError("Mock object has no attribute %r" % name) AttributeError: Mock object has no attribute 'value'
* processor: Catch SyntaxError also when generating tokens for a fileEric N. Vander Weele2020-06-021-0/+11
| | | | | `tokenize.generate_tokens()` can also raise `SyntaxError` in addition to `tokenize.TokenError`.
* treat --extend-exclude as a file listAnthony Sottile2020-05-211-1/+1
|
* options: Forward `--output-file` to be reparsed for BaseFormatterEric N. Vander Weele2020-05-111-0/+14
| | | | | | | | | This fixes a regression introduced in daca2c8 and b14d47b. The --output-file` option was consumed by the preliminary option parser. However, the `BaseFormatter` class needs the option for setting the output filename. This special cases this option to ensure it gets re-parsed and respected when specified on the CLI.
* Fix logical checks which report position out of boundsAnthony Sottile2020-05-071-0/+22
|
* instrument coverage on tests and require 100% coverage thereAnthony Sottile2020-03-232-6/+0
|
* Allow noqa to apply to lines due to continuationnoqa_continuationAnthony Sottile2020-03-172-5/+23
|
* Merge branch 'file_not_found_error' into 'master'Anthony Sottile2020-01-162-1/+10
|\ | | | | | | | | | | | | Ensure that a not-found file produces an error Closes #600 See merge request pycqa/flake8!404
| * Ensure that a not-found file produces an errorAnthony Sottile2020-01-162-1/+10
| | | | | | | | - this restores a flake8 2.x behaviour that was lost in the refactor
* | split lines the same when read from stdinAnthony Sottile2020-01-161-0/+23
|/
* config: Make ConfigFileFinder 'extra_config_files' parameter optionalEric N. Vander Weele2020-01-121-2/+1
| | | | | This simplifies the number of required parameters needed for the `ConfigFileFinder` object throughout the various tests.
* Remove unused 'cli_config' parameterEric N. Vander Weele2020-01-121-2/+2
| | | | | | Now that `ConfigFileFinder.config_file` attribute is used everywhere and is constructed from the `--config` CLI option, the now unused `cli_config` parameters can be safely removed.
* config: Switch code paths to use 'ConfigFileFinder.config_file'Eric N. Vander Weele2020-01-121-1/+4
| | | | | | | | Now that the `ConfigFileFinder` has the `.config_file` attribute, switch the relevant code paths to utilize this public attribute. Tests have been updated to either construct `ConfigFileFinder` or mock the object appropriately.
* Remove unused 'isolated' parameterEric N. Vander Weele2020-01-071-2/+2
| | | | | | Now that `ConfigFileFinder.ignore_config_files` attribute is used everywhere and is constructed from the `--isolated` CLI option, the now unused `isolated` parameters can be safely removed.
* config: Switch code paths to use 'ConfigFileFinder.ignore_config_files'Eric N. Vander Weele2020-01-071-1/+2
| | | | | | | | | Now that the `ConfigFileFinder` has the `.ignore_config_files` attribute, switch the relevant code paths to utilize this public attribute. Tests have been updated to either construct `ConfigFileFinder` or mock the object appropriately.
* tests: Add integration tests for `--config` and `--isolated`Eric N. Vander Weele2019-12-291-0/+28
| | | | | Prevent regressions by adding integration tests to ensure that these options are passed through to `aggregator.aggregate_options()`.
* aggregator: Forward --config and --isolated options during aggregationEric N. Vander Weele2019-12-291-6/+4
| | | | | | | | | | | | | | This fixes a regression introduced in !346 to ensure that `--config` and `--isolated` are recognized in `aggregate_options()`. The regression manifested because `aggregate_options()` was relying on re-parsing `argv` to obtain the option values. However, !346 changed the preliminary parsing logic to only parse and "eat" what is necessary and forward along the options needed before all the configuration was loaded. This code path was overlooked because the tests in `test_aggregator()` were passing but the call from the `Application` object would never have these options in the remaining `argv` list to be passed long.
* Switch from entrypoints to importlib_metadataAnthony Sottile2019-11-281-1/+6
|
* Merge branch 'separate-prelim-options' into 'master'Anthony Sottile2019-10-311-0/+4
|\ | | | | | | | | Separate pre-configuration CLI parsing See merge request pycqa/flake8!364
| * application: Register preliminary options on a separate argument parserEric N. Vander Weele2019-10-251-1/+4
| | | | | | | | | | | | | | | | | | | | We introduce a new `ArgumentParser` for registering the preliminary options to be inherited by the `Application.option_manager`. The next step will be to use the `Application.prelim_arg_parser` for parsing and handling preliminary options and arguments. Note that we prevent the preliminary parser from handling `-h/--help` and defer to that to the primary parser.
| * options: Split-out registration of preliminary optionsEric N. Vander Weele2019-10-251-0/+1
| | | | | | | | | | This is in preparation for having separate `ArgumentParser`s for preliminary and the remaining options.
* | Merge branch 'specific_noqa_pycodestyle' into 'master'Anthony Sottile2019-10-281-0/+12
|\ \ | |/ |/| | | | | | | | | Do not pass `noqa` to plugins, have flake8 decide whether to report Closes #552 See merge request pycqa/flake8!331
| * Do not pass `noqa` to plugins, have flake8 decide whether to reportAnthony Sottile2019-08-291-0/+12
| |
* | config: Remove `args` parameter from `ConfigFileFinder.__init__`Eric N. Vander Weele2019-10-131-2/+2
| | | | | | | | | | | | | | | | Now that `args` parameters is not being used, it is safe to remove from the constructor signature. Further work is required to evaluate and clean-up tearing out the threading-through of `args` from various callers and tests.
* | Don't reset indent_char when we encounter E101Anthony Sottile2019-09-241-0/+19
|/
* Hoist passing through sys.argv at the CLI layerEric N. Vander Weele2019-08-291-0/+10
| | | | | | | | | | | | | | | | | | | `flake8.main.cli.main()` is the primary entry point for the command-line implementation of flake8 (invoked via `__main__` or `console_scripts`). Therefore, it is reasonable for the entry point to be responsible for obtaining command line arguments from `sys.argv` there. Note that `sys.argv[1:]` is necessary in order to strip off the script name. Formerly, this was not needed in `Application.parse_preliminary_options_and_args()`, which was using `sys.argv[:]` because the result of the argument parsing was just for determining additional configuration to be loaded. Then, the *real* CLI argument parsing was forwarding the original `None` value to `argparse.ArgumentParser.parse_args()`, which internally was obtaining arguments as `sys.argv[1:]`. Additionally, the contract for various argument parsing methods to be guaranteed a `List[str]`.
* move from optparse to argparseAnthony Sottile2019-08-171-14/+22
|
* Fix / improve recently merged patches + CIAnthony Sottile2019-07-081-1/+4
|
* support extend-exclude Fixes #535Thomas Grainger2019-07-082-2/+17
|
* mypy now passesAnthony Sottile2019-05-191-6/+4
|
* Fix crash when file fails to tokenize but parsesAnthony Sottile2019-04-071-0/+14
|
* Improve error message for malformed per-file-ignoresAnthony Sottile2019-01-301-0/+27
|
* Fix flake8 --statisticsAnthony Sottile2019-01-301-1/+18
|
* Fix legacy api invocation of make_notifierAnthony Sottile2019-01-301-0/+13
|
* Add integration test for `flake8 --diff`Anthony Sottile2019-01-301-0/+43
|
* checker: allow physical checks to return multiple results, add testsTom Milligan2018-12-101-7/+81
|
* Replace setuptools with entrypointsAnthony Sottile2018-11-051-4/+3
|