How to call fixtures in non pytest framework #9501
Unanswered
chetana271285
asked this question in
Q&A
Replies: 2 comments 5 replies
-
Hi @chetana271285, We will need more details:
|
Beta Was this translation helpful? Give feedback.
4 replies
-
Hi,
I am writing the tests in pytest that calls the inhouse framework ( I'm
trying to get rid of the high level script that calls the inhouse framework
). However I am stuck with one thing here.
As per current framework, the setup configuration has config.yaml and test
cases has testcases.yaml files. The config files are read inside the
inhouse framework.
I am trying to change this to fixtures so that they will be available for
all the tests. But the problem is how do I pass the fixtures to the inhouse
framework? I am trying to parametrize the inhouse framework classes so that
I call them from test methods(which have access to fixtures) . Is it the
right way or is there any better way ?
…On Wed, Jan 12, 2022 at 11:07 AM Bruno Oliveira ***@***.***> wrote:
Currently, the in house framework has its own runner to run the tests and
these tests are not modular .
Hmm you mean you have a high-level script which calls into your in house
framework, and then pytest?
import pytestimport in_house_fw
in_house_fw.main(["src"])pytest.main(["src"])
In that case I don't think it is really possible to share the fixture
information between them. Perhaps an alternative would be to write a plugin
to enable pytest to run the in-house framework's tests? This would allow to
eventually bridge the gap between the two.
—
Reply to this email directly, view it on GitHub
<#9501 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXHX67CDGOQAG4YXEEHSOIDUVXGQFANCNFSM5LU5OZZQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an in house test framework and I am trying to migrate it to Pytest. My new code has fixtures and test functions. But to migrate the existing classes to pytest framework, how can I call the fixture and return the value to the inhouse framework class.
Now I would like to apply the
read_data
fixture cached value to old class1.py self.test_data_dir if called from pytest. Is there a way to do this?Beta Was this translation helpful? Give feedback.
All reactions