Problem in using from a packaged pytest framework


I am working on a pytest-framework that will be packed as a package. The setup file i am using for this is as this:

author='my name',
author_email='[email protected]',
description='My test framework',
long_description=open('', 'rb').read().decode('utf-8'),
license="Free loot",

entry_points={"pytest11": ["MyTestFrameWork = MyTestFrameWork"]},

In this package (in the root of this folder MyTestFrameWork ) I have a with some fixtures.

MY problem/Question:
When I import my framework from another python project eg: by importing the testframework. I cant get the framework to use the fixtures in the conftest …… however,….

if i move the content from the into in my framework ie: in MyTestFrameWork folder the fixtures are working as expected.

why it is like this ….why cant i have my fixtures in the instead of having them in the am i missing something ?

for better view of my file-structure on the framework:

enter image description here

Asked By: KapaA



You are missing the conftest module in the entry_points definition. The syntax is following:

entry_points={"pytest11": ["name_of_plugin = myproject.pluginmodule"]}

This means that for Pytest to load the fixtures from, the setup should be following:

    entry_points={"pytest11": ["MyTestFrameWork = MyTestFrameWork.conftest"]},

However, is typically meant for auto-discovery within tests so in a plugin I’d actually use a different name for the module containing the fixtures.

Answered By: tmt
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.