Last active
October 2, 2023 07:11
-
-
Save prashanth-sams/15cfcb3ef21c6984134fb3f47f9b6ab3 to your computer and use it in GitHub Desktop.
Pytest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
class TestData(): | |
@pytest.mark.parametrize('execution_number', range(5)) | |
def test_foo(self, execution_number): | |
assert 1 == execution_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.mark.parametrize('execution_number', range(5)) | |
def test_foo(self, execution_number): | |
assert 1 == execution_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.fixture(scope="session") | |
def data(): | |
assert False | |
class TestData(): | |
@pytest.mark.usefixtures('data') | |
def test_foo(self): | |
assert 'prasha' in "prashanth" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pytest - Python - Appium