Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that the dependency marker also works if applied to a class as a whole #39

Closed
RKrahl opened this issue Apr 11, 2020 · 0 comments · Fixed by #59
Closed

Document that the dependency marker also works if applied to a class as a whole #39

RKrahl opened this issue Apr 11, 2020 · 0 comments · Fixed by #59
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@RKrahl
Copy link
Owner

RKrahl commented Apr 11, 2020

@anishradvani requested in #38 that it should be possible to apply the dependency marker on a test class rather then to an individual method. Actually, it turns out that this already works. Consider:

import pytest


@pytest.mark.dependency()
@pytest.mark.xfail(reason="deliberate fail")
def test_f():
    assert False


@pytest.mark.dependency(depends=["test_f"])
class TestClass(object):

    def test_a(self):
        pass

    @pytest.mark.dependency()
    def test_b(self):
        pass

    def test_c(self):
        pass

This will have the effect that test_a and test_c will be skipped, because they depend on test_f, while test_b will be run.

@RKrahl RKrahl added the documentation Improvements or additions to documentation label Apr 11, 2020
@RKrahl RKrahl added this to the 0.6 milestone Apr 11, 2020
@RKrahl RKrahl mentioned this issue Dec 31, 2021
4 tasks
@RKrahl RKrahl closed this as completed in 65dc1f5 Dec 31, 2023
github-merge-queue bot referenced this issue in linz/topo-imagery Sep 8, 2024
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [pytest-dependency](https://github.com/RKrahl/pytest-dependency)
from 0.5.1 to 0.6.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/RKrahl/pytest-dependency/blob/develop/CHANGES.rst">pytest-dependency's
changelog</a>.</em></p>
<blockquote>
<p>0.6.0 (2023-12-31)</p>
<pre><code>
Documentation
-------------
<ul>

<li><code>[#39](https://github.com/RKrahl/pytest-dependency/issues/39)</code><em>,
<code>[#41](https://github.com/RKrahl/pytest-dependency/issues/41)</code></em>,
<code>[#59](https://github.com/RKrahl/pytest-dependency/issues/59)</code>_:
Review documentation</li>
</ul>
<h2>Incompatible changes</h2>
<ul>
<li>Drop support for Python 2.</li>
</ul>
<h2>Bug fixes and minor changes</h2>
<ul>

<li><code>[#40](https://github.com/RKrahl/pytest-dependency/issues/40)</code>_:
add logging.</li>

<li><code>[#50](https://github.com/RKrahl/pytest-dependency/issues/50)</code><em>,
<code>[#51](https://github.com/RKrahl/pytest-dependency/issues/51)</code></em>:
test suite incompatibility with pytest 6.2.0.</li>

<li><code>[#58](https://github.com/RKrahl/pytest-dependency/issues/58)</code>_:
declare the type of automark_dependency ini-option correctly
as bool.</li>
</ul>
<h2>Internal</h2>
<ul>

<li><code>[#75](https://github.com/RKrahl/pytest-dependency/issues/75)</code>_:
review build tool chain.</li>
</ul>
<p>.. _<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/39">#39</a>:
<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/39">RKrahl/pytest-dependency#39</a>
.. _<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/40">#40</a>:
<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/40">RKrahl/pytest-dependency#40</a>
.. _<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/41">#41</a>:
<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/41">RKrahl/pytest-dependency#41</a>
.. _<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/50">#50</a>:
<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/50">RKrahl/pytest-dependency#50</a>
.. _<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/51">#51</a>:
<a
href="https://redirect.github.com/RKrahl/pytest-dependency/pull/51">RKrahl/pytest-dependency#51</a>
.. _<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/58">#58</a>:
<a
href="https://redirect.github.com/RKrahl/pytest-dependency/pull/58">RKrahl/pytest-dependency#58</a>
.. _<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/59">#59</a>:
<a
href="https://redirect.github.com/RKrahl/pytest-dependency/pull/59">RKrahl/pytest-dependency#59</a>
.. _<a
href="https://redirect.github.com/RKrahl/pytest-dependency/issues/75">#75</a>:
<a
href="https://redirect.github.com/RKrahl/pytest-dependency/pull/75">RKrahl/pytest-dependency#75</a>
</code></pre></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/2cae58956bff640bbfbbdc8212cae97b7967453c"><code>2cae589</code></a>
Merge branch 'develop'</li>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/def647eda5778fc5b0ffebb7251c81e804f50089"><code>def647e</code></a>
Prepare release 0.6.0</li>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/2baac9b866777f8fa353defe6c4a770f0df90d85"><code>2baac9b</code></a>
Merge branch 'doc' into develop</li>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/38baf8cb5f561dcf16539c8304b0f71898a625f6"><code>38baf8c</code></a>
Update changelog</li>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/e2edf54383b3b8f2c137d78677debfd63b23ba95"><code>e2edf54</code></a>
Explicitely set language to 'en'</li>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/f11cf56ca553992891d80ce79bbbac82aa40d285"><code>f11cf56</code></a>
Rewrite introduction to the debugging guide</li>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/346a3441efbf26dfad83e277ab6ccac26cfe6d75"><code>346a344</code></a>
Move the changelog to the end, after the API reference</li>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/463227e4519e444701f22acadf3442c1b45e5214"><code>463227e</code></a>
Review README and bump copyright year</li>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/eb48f326af4428f7e292bc980c80a02686650832"><code>eb48f32</code></a>
Fixup 695ea27: trailing whitespace</li>
<li><a
href="https://github.com/RKrahl/pytest-dependency/commit/695ea2742af78fe65a5b17426170b481666ec0a2"><code>695ea27</code></a>
Update install instructions</li>
<li>Additional commits viewable in <a
href="https://github.com/RKrahl/pytest-dependency/compare/0.5.1...0.6.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pytest-dependency&package-manager=pip&previous-version=0.5.1&new-version=0.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has
been open for over 30 days.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant