Skip to content

Commit

Permalink
Restructure pickle test to for extra plugins
Browse files Browse the repository at this point in the history
Running in isolation and as part of the full suite cause different
default plugins to be loaded, which throw different pickling errors.
This will now catch all of them, and still fail the test if all of those
modules become pickle safe in future.
  • Loading branch information
daogilvie committed Oct 18, 2022
1 parent 1c06535 commit 695fc14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_check_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,12 @@ def test_linter_with_unpickleable_plugins_is_pickleable(self) -> None:
linter = PyLinter(reporter=Reporter())
# We load an extension that we know is not pickle-safe
linter.load_plugin_modules(["pylint.extensions.overlapping_exceptions"])
with pytest.raises(KeyError):
try:
dill.dumps(linter)
assert False, "Plugins loaded were pickle-safe! This test needs altering"
except (KeyError, TypeError, dill.PickleError):
pass

# And expect this call to make it pickle-able
linter.load_plugin_configuration()
try:
Expand Down

0 comments on commit 695fc14

Please sign in to comment.