conftest.py
import pytest
@pytest.fixture(scope="session")
def client():
env_name = 'FLASK_ENV'
return env_name
@pytest.fixture(scope="session")
def client_1():
env_name = 'FLASK_ENV_1'
return env_name
test_run.py
import pytest
import unittest
@pytest.mark.usefixtures("client")
@pytest.mark.usefixtures("client_1")
class TestStaticPages(unittest.TestCase):
@classmethod
def setUpClass(self):
self.value = "ABC"
def test_base_route(self, client, client_1):
response = client
assert response == 'FLASK_ENV'
assert client_1 == 'FLASK_ENV_1'
I am new to UnitTest in python. When I am trying to use fixtures in the test class it is failing.
Could you please help me with the solution.
Thanks in advance.