Skip to content

Getting error: AttributeError: 'Tests' object has no attribute 't' #3869

Closed
@vipkum2

Description

@vipkum2

I am using below code, It was working fine with pytest version 3.0.4, not working with 3.7.2
Python version: 3.6 on linux

class Tests(object):
     @classmethod
     @pytest.fixture(scope='module', autouse=True)
     def getTestFixture(self, request):
        self.fixtureIp   = request.config.getoption('--fixtureIp')
        print()
        print('Fixture IP           : %s' % (self.fixtureIp))
        # Connect to the NE
        self.t = OpenRoadmTest(self.fixtureIp)
        self.t.connectTL1()
        print(self.t) #working fine

     def test00_getStartingConfig(self,):
        print(self.t)
        #not working , showing error: AttributeError: 'Tests' object has no attribute 't'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions