question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

help - documentation improvement - grouping test by class - how to share values

See original GitHub issue

Following this example https://docs.pytest.org/en/latest/getting-started.html#group-multiple-tests-in-a-class i would like to make a test workflow. the second test needs result obtained from the first test. i’m not able to share these information.

i’m using python 3.7.4 and pytest-5.2.1

as you can see,

even if i set a parameter to the class, this parameter look like already evaluated when the second test start.

import pytest
@pytest.mark.incremental
class TestUserHandling:
    id = "1"
    def test_login(self):
        print("id value --> " + self.id)
        self.id = "2"
        print("id value --> " + self.id)
        pass

    def test_modification(self):
        assert self.id == "2", "self id value is " + self.id

first test returns

b__test_step.py::TestUserHandling::test_login PASSED
id value --> 1
id value --> 2

second test returns

AssertionError: self id value is 1
1 != 2

second test needs data from the first test to make the job.

how can i obtain this behaviour?

thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
RonnyPfannschmidtcommented, Oct 11, 2019

currently the setups im involved in do workflws&co by just setting up the dependencies for each test in fixtures, even if its expensive in some ways, and then use caching7scopes to sort out the cost

0reactions
RonnyPfannschmidtcommented, Oct 11, 2019

thanks for the follow-up

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I assess group work? - Eberly Center
Assess individual, as well as group, learning and performance. ... they feel that their own success is dependent on team members who don't...
Read more >
Instructional Grouping in the Classroom - Education Northwest
The team goal is to help one another complete assigned tasks successfully and to improve each student's performance on a quiz measuring skills...
Read more >
Clinical Documentation Integrity Education & Training - AHIMA
Do you have data-driven best practices to share that elevate the health ... Certified Documentation Improvement Practitioner (CDIP) Exam Preparation.
Read more >
What Is Clinical Documentation Improvement (CDI)? - AAPC
CDI (Clinical Documentation Improvement) is the process of improving medical record documentation for completeness, specifics, and accuracy.
Read more >
How to Write Test Cases: The Ultimate Guide with Examples
How to Improve Test Case Efficiency. Document Collection for Test Writing; Real Example; Test Case Document; Test Data Collection.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found