flake8/tests/integration
Nekokatt e6a5f6a663 Support linting when missing sem_open syscall
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.
2020-08-27 15:41:25 -07:00
..
subdir instrument coverage on tests and require 100% coverage there 2020-03-23 12:15:29 -07:00
test_aggregator.py config: Make ConfigFileFinder 'extra_config_files' parameter optional 2020-01-12 23:28:52 -05:00
test_api_legacy.py Fix legacy api invocation of make_notifier 2019-01-30 11:00:36 -08:00
test_checker.py Support linting when missing sem_open syscall 2020-08-27 15:41:25 -07:00
test_main.py processor: Catch SyntaxError also when generating tokens for a file 2020-06-02 11:38:44 -07:00
test_plugins.py instrument coverage on tests and require 100% coverage there 2020-03-23 12:15:29 -07:00