[Tests] don't name test plugin 'testing"

If so named, pip won't install it.
This commit is contained in:
MinchinWeb 2021-05-16 21:12:32 -06:00
parent d63ba471ca
commit 3492dd291a
6 changed files with 24 additions and 21 deletions

View file

@ -168,6 +168,7 @@ situations other than a traditional export. They are:
- editable installs (`pip install -e ...`) don't seem to play nice with - editable installs (`pip install -e ...`) don't seem to play nice with
the namespace layout. If your plugin isn't appearing, try a non-editable the namespace layout. If your plugin isn't appearing, try a non-editable
install of both *jrnl* and your plugin. install of both *jrnl* and your plugin.
- for examples, you can look to the *jrnl*'s internal importers and exporters. - Don't name your plugin file "testing.py" or it won't be installed (at least
automatically) by pip.
As well, there are some basic external examples included in *jrnl*'s git repo As well, there are some basic external examples included in *jrnl*'s git repo
at `tests/external_plugins_src` (including the example code above). at `tests/external_plugins_src` (including the example code above).

View file

@ -5,7 +5,7 @@ import shutil
from jrnl.os_compat import on_windows from jrnl.os_compat import on_windows
try: try:
from jrnl.contrib.exporter import testing as testing_exporter from jrnl.contrib.exporter import flag as testing_exporter
except ImportError: except ImportError:
testing_exporter = None testing_exporter = None

View file

@ -33,25 +33,25 @@ Feature: Functionality of Importer and Exporter Plugins
Then the output should contain pyproject.toml version Then the output should contain pyproject.toml version
And The output should contain "<plugin_name> : <version> from jrnl.<source>.<type>.<filename>" And The output should contain "<plugin_name> : <version> from jrnl.<source>.<type>.<filename>"
Examples: Examples:
| plugin_name | version | source | type | filename | | plugin_name | version | source | type | filename |
| jrnl | <pyproject.toml version> | plugins | importer | jrnl | | jrnl | <pyproject.toml version> | plugins | importer | jrnl |
| json | v1.0.0 | contrib | importer | json | | json | v1.0.0 | contrib | importer | simple_json |
| boxed | <pyproject.toml version> | plugins | exporter | fancy | | boxed | <pyproject.toml version> | plugins | exporter | fancy |
| dates | <pyproject.toml version> | plugins | exporter | dates | | dates | <pyproject.toml version> | plugins | exporter | dates |
| default | <pyproject.toml version> | plugins | exporter | pretty | | default | <pyproject.toml version> | plugins | exporter | pretty |
| fancy | <pyproject.toml version> | plugins | exporter | fancy | | fancy | <pyproject.toml version> | plugins | exporter | fancy |
| json | v1.0.0 | contrib | exporter | json | | json | v1.0.0 | contrib | exporter | custom_json |
| markdown | <pyproject.toml version> | plugins | exporter | markdown | | markdown | <pyproject.toml version> | plugins | exporter | markdown |
| md | <pyproject.toml version> | plugins | exporter | markdown | | md | <pyproject.toml version> | plugins | exporter | markdown |
| pretty | <pyproject.toml version> | plugins | exporter | pretty | | pretty | <pyproject.toml version> | plugins | exporter | pretty |
| rot13 | v1.0.0 | contrib | exporter | rot13 | | rot13 | v1.0.0 | contrib | exporter | rot13 |
| short | <pyproject.toml version> | plugins | exporter | short | | short | <pyproject.toml version> | plugins | exporter | short |
| tags | <pyproject.toml version> | plugins | exporter | tag | | tags | <pyproject.toml version> | plugins | exporter | tag |
| testing | v0.0.1 | contrib | exporter | testing | | testing | v0.0.1 | contrib | exporter | flag |
| text | <pyproject.toml version> | plugins | exporter | text | | text | <pyproject.toml version> | plugins | exporter | text |
| txt | v1.0.0 | contrib | exporter | rot13 | | txt | v1.0.0 | contrib | exporter | rot13 |
| xml | <pyproject.toml version> | plugins | exporter | xml | | xml | <pyproject.toml version> | plugins | exporter | xml |
| yaml | <pyproject.toml version> | plugins | exporter | yaml | | yaml | <pyproject.toml version> | plugins | exporter | yaml |
@skip_only_with_external_plugins @skip_only_with_external_plugins
Scenario Outline: Do not list overridden plugin names in --version Scenario Outline: Do not list overridden plugin names in --version

View file

@ -6,6 +6,8 @@
""" """
Exporter for testing and experimentation purposes. Exporter for testing and experimentation purposes.
It is not called "testing" because then it's not installed.
The presence of this plugin is also used as a "switch" by the test suite to The presence of this plugin is also used as a "switch" by the test suite to
decide on whether or not to run the "vanilla" test suite, or the test suite decide on whether or not to run the "vanilla" test suite, or the test suite
for external plugins. for external plugins.