Skip to content

Instantly share code, notes, and snippets.

@prashanth-sams
Last active October 2, 2023 07:11
Show Gist options
  • Save prashanth-sams/15cfcb3ef21c6984134fb3f47f9b6ab3 to your computer and use it in GitHub Desktop.
Save prashanth-sams/15cfcb3ef21c6984134fb3f47f9b6ab3 to your computer and use it in GitHub Desktop.
Pytest
import pytest
@pytest.fixture(autouse=True)
def data():
assert False
class TestData():
def test_foo(self):
assert 'prasha' in "prashanth"
def test_foo2(self):
assert 'prasha' in "prashanth"
import pytest
class TestData():
@pytest.mark.parametrize('execution_number', range(5))
def test_foo(self, execution_number):
assert 1 == execution_number
import pytest
@pytest.mark.parametrize('execution_number', range(5))
def test_foo(self, execution_number):
assert 1 == execution_number
import pytest
@pytest.fixture(scope="session")
def data():
assert False
@pytest.fixture(scope="session")
def data2():
assert False
@pytest.mark.usefixtures('data', 'data2')
class TestData():
def test_foo(self):
assert 'prasha' in "prashanth"
import pytest
@pytest.fixture(scope="session")
def data():
assert False
class TestData():
@pytest.mark.usefixtures('data')
def test_foo(self):
assert 'prasha' in "prashanth"
@prashanth-sams
Copy link
Author

Pytest - Python - Appium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment