import pytest
import tweepy
import vcr

from secrets import TWITTER_ACCESS, TWITTER_SECRET
from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET


class TestTweepyIntegration():
    """Test class to ensure tweepy functionality works as expected"""
    # Class level client to use across tests
    auth = tweepy.OAuthHandler(TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET)
    auth.set_access_token(TWITTER_ACCESS, TWITTER_SECRET)

    @vcr.use_cassette('fixtures/vcr_cassettes/twitter.yaml')
    def test_authd(self):
        api = tweepy.API(self.auth)
        assert api.verify_credentials() is not False

if __name__ == '__main__':
    pytest.main()

import pytest
import vcr

from inet.sources.twitter import api


class TestTweepyIntegration():
    """Test class to ensure tweepy functionality works as expected"""
    @vcr.use_cassette('fixtures/vcr_cassettes/twitter.yaml')
    def test_authd(self):
        assert api.verify_credentials() is not False

if __name__ == '__main__':
    pytest.main()

Change tests to pull in twitter client from package
Change tests to pull in twitter client from package

  import pytest
- import tweepy
  import vcr
  
+ from inet.sources.twitter import api
- from secrets import TWITTER_ACCESS, TWITTER_SECRET
- from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET
  
  
  class TestTweepyIntegration():
      """Test class to ensure tweepy functionality works as expected"""
-     # Class level client to use across tests
-     auth = tweepy.OAuthHandler(TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET)
-     auth.set_access_token(TWITTER_ACCESS, TWITTER_SECRET)
- 
      @vcr.use_cassette('fixtures/vcr_cassettes/twitter.yaml')
      def test_authd(self):
-         api = tweepy.API(self.auth)
          assert api.verify_credentials() is not False
  
  if __name__ == '__main__':
      pytest.main()
  
Change tests to pull in twitter client from package
## Code Before:
import pytest
import tweepy
import vcr

from secrets import TWITTER_ACCESS, TWITTER_SECRET
from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET


class TestTweepyIntegration():
    """Test class to ensure tweepy functionality works as expected"""
    # Class level client to use across tests
    auth = tweepy.OAuthHandler(TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET)
    auth.set_access_token(TWITTER_ACCESS, TWITTER_SECRET)

    @vcr.use_cassette('fixtures/vcr_cassettes/twitter.yaml')
    def test_authd(self):
        api = tweepy.API(self.auth)
        assert api.verify_credentials() is not False

if __name__ == '__main__':
    pytest.main()

## Instruction:
Change tests to pull in twitter client from package
## Code After:
import pytest
import vcr

from inet.sources.twitter import api


class TestTweepyIntegration():
    """Test class to ensure tweepy functionality works as expected"""
    @vcr.use_cassette('fixtures/vcr_cassettes/twitter.yaml')
    def test_authd(self):
        assert api.verify_credentials() is not False

if __name__ == '__main__':
    pytest.main()
