Skip to content

Commit

Permalink
fix/adjust test_disable_plugin_autoload
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jan 11, 2020
1 parent 0652304 commit 60469ee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions testing/test_config.py
Expand Up @@ -665,6 +665,13 @@ class Distribution:
class PseudoPlugin:
x = 42

attrs_used = []

def __getattr__(self, name):
assert name == "__loader__"
self.attrs_used.append(name)
return object()

def distributions():
return (Distribution(),)

Expand All @@ -674,6 +681,10 @@ def distributions():
config = testdir.parseconfig(*parse_args)
has_loaded = config.pluginmanager.get_plugin("mytestplugin") is not None
assert has_loaded == should_load
if should_load:
assert PseudoPlugin.attrs_used == ["__loader__"]
else:
assert PseudoPlugin.attrs_used == []


def test_cmdline_processargs_simple(testdir):
Expand Down

0 comments on commit 60469ee

Please sign in to comment.