Page MenuHomeSoftware Heritage

conftest: Declare swh.core pytest_plugin
ClosedPublic

Authored by ardumont on Oct 7 2020, 3:47 PM.

Details

Summary

As the other pytest plugin are declared.

The pytest.ini modification is required because it autoloads (as in D4051 for
example).

I tried to stop swh.core from autoloading its fixture but it's apparently more
complex than anticipated [1]. I don't want to plunge in there just yet so here
goes.

[1] D4181

Test Plan

tox

Diff Detail

Repository
rDDEP Push deposit
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D4182 (id=14728)

Rebasing onto cd9c04afe6...

Current branch diff-target is up to date.
Changes applied before test
commit 98dcf27419726acb0e3cefaf1859346abffa4546
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Oct 7 15:08:29 2020 +0200

    conftest: Declare swh.core pytest_plugin

See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/176/ for more details.

does this requires the plugin's entrypoint in swh.core be removed ? (eg. because of swh.core.pytest_plugin being loaded twice or something like that) or is it safe to apply and use with a swh.core that still declates its pytest_plugin an entrypoint?

otherwise fine with me

This revision is now accepted and ready to land.Oct 8 2020, 5:56 PM

does this requires the plugin's entrypoint in swh.core be removed ?

interesting, maybe.
I don't recall testing to remove its conftest entry pytest_plugins (if that's what you are suggesting)
when i tried to stop swh.core from autoloading its plugin D4181.

(eg. because of swh.core.pytest_plugin being loaded twice or something like that) or is it safe to apply and use with a swh.core that still declates its pytest_plugin an entrypoint?

well, my tests on this says, no, it's not safe.
but like i said in the description, i'll have a more thorough look later ;)

I don't recall testing to remove its conftest entry pytest_plugins (if that's what you are suggesting)

I think that's not what you suggested but what i tried to do in D4181 which just did not work yet...
I must have not poke enough at it though ;)

This revision was automatically updated to reflect the committed changes.