(tmp_path)
| 68 | |
| 69 | |
| 70 | def test_discover_plugins(tmp_path): |
| 71 | legacy_plugin_folder = tmp_path / "cz_legacy" |
| 72 | legacy_plugin_folder.mkdir() |
| 73 | init_file = legacy_plugin_folder / "__init__.py" |
| 74 | init_file.write_text( |
| 75 | dedent( |
| 76 | """\ |
| 77 | class Plugin: pass |
| 78 | |
| 79 | discover_this = Plugin |
| 80 | """ |
| 81 | ) |
| 82 | ) |
| 83 | |
| 84 | sys.path.append(tmp_path.as_posix()) |
| 85 | with pytest.warns( |
| 86 | UserWarning, |
| 87 | match="Legacy plugin 'cz_legacy' has been ignored: please expose it the 'commitizen.plugin' entrypoint", |
| 88 | ): |
| 89 | discovered_plugins = discover_plugins([tmp_path.as_posix()]) |
| 90 | sys.path.pop() |
| 91 | |
| 92 | assert "cz_legacy" not in discovered_plugins |
| 93 | |
| 94 | |
| 95 | def test_discover_external_plugin(mocker): |
nothing calls this directly
no test coverage detected