Skip to content

Commit

Permalink
Fix automark_dependency handling for pytest-dependency main
Browse files Browse the repository at this point in the history
- use Python 3.10 instead of pre-release version in CI
- add some documentation links in README
- fixes pytest-dev#58
  • Loading branch information
mrbean-bremen committed Jan 9, 2022
1 parent 1b8b9fb commit 9c9b31d
Showing 5 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythontests.yml
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10-dev, pypy3]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", pypy3]
exclude:
- os: windows-latest
python-version: pypy3
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@
### Fixes
- correctly handle combined class and test order markers,
see [#45](https://github.com/pytest-dev/pytest-order/issues/45)
- adapt code to changed type of `automark_dependency` in development branch
of `pytest-dependency`,
see [#58](https://github.com/pytest-dev/pytest-order/issues/58)

## [Version 1.0.0](https://pypi.org/project/pytest-order/1.0.0/) (2021-05-30)
First Python 3 only version.
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -21,13 +21,34 @@ Documentation
Apart from this overview, the following information is available:
- usage documentation for the [latest release](https://pytest-dev.github.io/pytest-order/stable/)
- usage documentation for the [current main branch](https://pytest-dev.github.io/pytest-order/dev/)
- all examples shown in the documentation can also be found in the
- most examples shown in the documentation can also be found in the
[repository](https://github.com/pytest-dev/pytest-order/tree/main/example)
- the [Release Notes](https://github.com/pytest-dev/pytest-order/blob/main/CHANGELOG.md)
with a list of changes in the latest versions
- a [list of open issues](https://github.com/pytest-dev/pytest-order/blob/main/old_issues.md)
in the original project and their handling in `pytest-order`

Features
--------
`pytest-order` provides the following features:
- ordering of tests [by index](https://pytest-dev.github.io/pytest-order/stable/usage.html#ordering-by-numbers)
- ordering of tests both from the start and from the end (via negative
index)
- ordering of tests [relative to each other](https://pytest-dev.github.io/pytest-order/stable/usage.html#order-relative-to-other-tests)
(via the `before` and `after` marker attributes)
- session-, module- and class-scope ordering via the
[order-scope](https://pytest-dev.github.io/pytest-order/stable/configuration.html#order-scope) option
- directory scope ordering via the
[order-scope-level](https://pytest-dev.github.io/pytest-order/stable/configuration.html#order-scope-level) option
- hierarchical module and class-level ordering via the
[order-group-scope](https://pytest-dev.github.io/pytest-order/stable/configuration.html#order-group-scope) option
- ordering tests with `pytest-dependency` markers if using the
[order-dependencies](https://pytest-dev.github.io/pytest-order/stable/configuration.html#order-dependencies) option,
more information about `pytest-dependency` compatibility
[here](https://pytest-dev.github.io/pytest-order/stable/other_plugins.html#relationship-with-pytest-dependency)
- sparse ordering of tests via the
[sparse-ordering](https://pytest-dev.github.io/pytest-order/stable/configuration.html#sparse-ordering) option

Overview
--------
_(adapted from the original project)_
@@ -70,25 +91,6 @@ yields the output:

=========================== 2 passed in 0.01 seconds ===========================

Features
--------
`pytest-order` provides the following features:
- ordering of tests by index, as shown above
- ordering of tests both from the start and from the end (via negative
index)
- ordering of tests relative to each other (via the `before` and `after`
marker attributes)
- session-, module- and class-scope ordering via the ``order-scope`` option
- directory scope ordering via the ``order-scope-level`` option
- hierarchical module and class-level ordering via the ``group-order-scope``
option
- ordering tests with `pytest-dependency` markers if using the
``order-dependencies`` option
- sparse ordering of tests via the ``sparse-ordering`` option

A usage guide for each feature can be
found in the [documentation](https://pytest-dev.github.io/pytest-order/dev/).

Contributing
------------
Contributions are very welcome. Tests can be run with
9 changes: 5 additions & 4 deletions pytest_order/settings.py
Original file line number Diff line number Diff line change
@@ -56,9 +56,10 @@ def __init__(self, config: Config) -> None:
self.group_scope = self.scope
try:
auto_mark_dep = config.getini("automark_dependency")
if isinstance(auto_mark_dep, str):
auto_mark_dep = auto_mark_dep.lower() in (
"1", "yes", "y", "true", "t", "on"
)
except ValueError:
auto_mark_dep = False
self.auto_mark_dep = (
auto_mark_dep
and auto_mark_dep.lower() in ("1", "yes", "y", "true", "t", "on")
)
self.auto_mark_dep = auto_mark_dep
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
{py36,py37,py38,py39,pypy3}-pytest{50,51,52,53,54,60,61,62}
{py310dev}-pytest{624}
{py310}-pytest{624}
[testenv]
deps =
pytest50: pytest>=5.0,<5.1

0 comments on commit 9c9b31d

Please sign in to comment.