[py-dev] plugin scoping or control

holger krekel holger at merlinux.eu
Mon Oct 3 05:36:53 CEST 2011


Hi Jason,

On Thu, Sep 29, 2011 at 14:39 -0700, Jason R. Coombs wrote:
> I've run into an issue with pytest_assertrepr_compare - I want the hook to
> apply to only a subset of tests (tests/unit/**), so I defined
> tests/unit/conftest.py and defined my pytest_assertrepr_compare there, but
> still tests under tests/other/** get that behavior (when I run py.test on
> tests/).
> 
> 
> 
> Is there a way to cause the hook to be loaded only for tests/unit/** (or
> some other subset of tests)? Alternatively, is there a way to detect from
> within the pytest_assertrepr_compare function which module/function is under
> test and select that way?

In principle it should be possible to have a conftest pytest_assertrepr_compare
apply only to a subdirectory.  The basic mechanism exists but this particular
hook is implemented in a special way and thus it requires some thinking/hacking
i am afraid.  Could you open an issue about this?

thanks,
holger

>  
> 
> Thanks,
> 
> Jason
> 



> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev




More information about the Pytest-dev mailing list