* Encapsulate all multiline strings in triple-quotes in Gherkin files
Since pytest-bdd v8.0.0 uses the official Gherkin parser, multiline
strings must now be encapsulated by triple-quotes.
See:
- https://pytest-bdd.readthedocs.io/en/stable/#id2
- https://pytest-bdd.readthedocs.io/en/stable/#docstrings
* Remove comments in Gherkin files causing test breakage
These comments break the step matching.
* Fix compatibility of step-functions matching on multiple lines
In pytest-bdd v8.0.0 it is no longer possible to match based on multiple
lines, which breaks essentially all steps that support docstrings. Solve
this by adding a wrapper-function for each of these instances, that
matches the docstring step, and calls the original function.
So, what used to be:
@then(parse("the output should match\n{regex}"))
@then(parse('the output should match "{regex}"'))
def output_should_match(regex, cli_run):
...
Is now:
@then(parse("the output should match"))
def output_should_match_docstring(cli_run, docstring):
output_should_match(docstring, cli_run)
@then(parse('the output should match "{regex}"'))
def output_should_match(regex, cli_run):
...
There is possibly a way around this that is much better than what I've
done here, but this is a start at least.
* Update version requirement of pytest-bdd to >=8.0
* Update tox config to match poetry config
---------
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* Support pytest_bdd 7.1.2 and later
Fix#1875.
* Prevent use of pytest 8.1 for now due to unrelated error
* poetry lock --no-update
---------
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* Stop ignoring parsedatetime warning flag style warning
* Use new VERSION_CONTEXT_STYLE to bypass parsedatetime flag style warning
* Replace "flag" and its magic numbers with contextual booleans
* Add ruff
* Add ruff config
* Add ruff rules that look useful and are already passing
* Add more ruff rules after talking with Jonathan
* Add line length exception for acceptably long indented line
* Resolve ruff line length 88 rule in args. Changing small lines but adding a noqa ignore directive to longer lines that look best as they are. Their dedented length is still less than 88
* poe format
* Resolve all remaining ruff line length errors
* Replace flake* and isort with ruff calls
* Add black --check as final lint step. ruff catches most but not all black formatting issues
* Remove unneeded flakeheaven setting
* Remove flake* and isort now that ruff is handling all their business
* Update pyproject, lockfile with latest version of ruff
* Document each ruff rule with comment
* Add black --version call before black --check
* Remove extraneous period
* Move path concerns to path.py and template concerns to editor.py -- BDD tests are failing
* Move path-related constants from config.py to path.py
* Mock get_templates_path in its new calling file
* Mediate template arg vs. config in controller then read template text in editor and unify those two use cases.
Some tests still failing
* Fix test whose message had changed
* poe format
* Refactor for easier unit testing and add unit tests
* Use path strings instead of Path objects in return values to prevent side effects that caused unit tests to fail on some platforms
* poe format
* Attempt to bypass getcwd errors in CI with patch
* Consistently use strings for paths instead of some strings and some pathlib.Path
* Keep pathlib within a function for readability
* fix for ruamel.yaml versions >=0.17.22
* Run poe format
---------
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
* update pytest-bdd to 6.0
* update lock file
* fix first test (inject command fixture to request)
* fix some more tests
* fix cli_run fixture
* fix password fixture
* Remove unused import
* Fix greedy should_or_should_not parsing problems while also consolidating its parse/transformation-to-bool code
* Prevent greedy matching in "we run" by using regular expression lookahead
* Add missing "Outline" in scenario outlines with examples
* Split "we use the config" and "we use no config" so pytest won't try to consume config_file as a fixture
* Fix missing ShouldOrShouldNot
* Formatting
* fix get_fixture function
* change output of failing test to be a little more useful
* update lock file
* update type builder to for should/should not to be in it's own file, rename some vars for readability
* add parse-type new dev/testing dependency
* update lock file
---------
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
* Use latest mkdocs version 1.4.2
* Add docs_theme to mkdocs watch so it automatically reloads localhost when modifying theme
* Bring in ReadTheDocs breadcrumb theme and fix display issues around "Docs" root breadcrumb
* The problem is CSS, not the breadcrumbs template. Tightly scope offending CSS and remove breadcrumbs template override
* Bring mkdocs ReadTheDocs breadcrumbs theme back in
* Fix pa11y validation issue by replacing breadcrumb a alt attribute with aria-label
* Attribute source of new breadcrumbs file
* Use mkdocs 1.4 or greater with no upper bound
* run format
* rename cli.py to main.py
* rename jrnl.py to controller.py
* move journal class files into journals dir
* rename start -> run in controller.py
* add black and isort to flakeheaven
* update lock file
* clean up poe config
* run formta on python blocks in markdown file
* disable code for black being confused about markdown
* add cache timeout for flakeheaven
See: https://github.com/flakeheaven/flakeheaven/issues/71
* Drop Python 3.9 and use Python 3.11 release instead of pre-release
* Run poetry lock
* Fix need for quoted 3.10 string
* Use 3.11.0-rc.2 for Python 3.11 for now
* Update minimum Python version in installation docs
* Change Python 3.11 RC version to 3.11
* Run docs and release workflows on Python 3.11
* Including Python 3.12 in allowable versions
* Restore poetry.lock from develop
* Run poetry lock --no-update
* Retrieve poetry.lock from develop and lock with --no-update
* poetry lock --no-update
* replace flake8 with flakeheaven
* update pyproject.toml for new flake tool
* update lock file
* change flake8 to flakeheaven in tests
* undo fix for poetry
* remove unused plugin marker for flakeheaven
* remove unused import in markdown file
* Attempt to exclude .venv from flakeheaven runs in CI
* Exclude more dirs from flakeheaven
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* update docs pipeline to use poe task runner
* move npm dependency into package.json file instead of hardcoding into pipeline
* replace nix-specific call with python version (for windows compat)
* update commands to use python for win compat
* update lock file
* change deps to take out xq and use xmltodict instead
* move script tasks from pyproject into new tasks.py
* run linting on new tasks.py file
* fix typo
* clean up pyproject to make valid toml
* update docs with correct task runner command
* use npx in case node_modules/.bin isn't in the path
* Run pa11y-ci in cross-platform manner (works on Windows)
* Add node_modules to .gitignore
* clean up poe alias
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* Clean up pyproject file
This reduces the differences between local tasks and tasks run in the CI
pipelines
* remove linting step (it's part of test now)
* remove useless arg
* add xdist for parallel test execution in pytest