title: pytest with classes python
body: <p>I wrote the following code : 
  publisher.py: </p>
  
  <pre><code>import six
  from google.api_core.exceptions import AlreadyExists
  from google.cloud.pubsub import types
  
  class publisher(object):
      """Publisher Object which has the following attributes
        Attributes:
            pubsub: publisher client
            project_name: Name of project
            topic_name: Name of topic
      """
  
      def __init__(self, pubsub, project_name, topic_name, batch_settings=(), *args, **kwargs):
          self.pubsub = pubsub
          self.project_name = project_name
          self.topic_name = topic_name
          self.batch_settings = types.BatchSettings(
              *batch_settings)  # Batch setting Pub/Sub accepts a maximum of 1,000 messages in a batch,
          # and the size of a batch can not exceed 10 megabytes
  
      def _full_project_name(self):
          """Returns Fully Qualified Name of project"""
          return self.pubsub.project_path(self.project_name)
  </code></pre>
  
  <p>and I wrote 3 test unfortunately the third one has been failing. 
  Below is the code I wrote for tests: </p>
  
  <p>test_publisher.py: </p>
  
  <pre><code>from google.cloud import pubsub
  import pytest
  from publisher import publisher
  
  PROJECT = 'ProjectTest'
  TOPIC_NAME = 'TopicTest'
  
  @pytest.fixture
  def pubsub():
      yield pubsub.PublisherClient()
  
  
  def test_init_value():
      sample_publisher=publisher(pubsub,PROJECT,TOPIC_NAME,())
      assert sample_publisher.project_name == 'ProjectTest'
      assert sample_publisher.topic_name == 'TopicTest'
      assert sample_publisher.pubsub == pubsub
      assert sample_publisher.batch_settings.max_messages == 1000
      assert sample_publisher.batch_settings.max_bytes == 10 * (2 ** 20)
      assert sample_publisher.batch_settings.max_latency == 0.05
  
  def test_init_with_no_values():
      with pytest.raises(Exception) as e_info:
          sample_bad_init = publisher()
  
  def test_full_project_name ():
      sample_publisher = publisher(pubsub, PROJECT, TOPIC_NAME, ())
  
      assert sample_publisher._full_project_name() == 'projects/ProjectTest'
  </code></pre>
  
  <p>I am currently getting the following error, which I can't understand, unfortunately:</p>
  
  <pre><code> line 26, in _full_project_name
      return self.pubsub.project_path(self.project_name)
  AttributeError: 'function' object has no attribute 'project_path'
  </code></pre>
  
  <p>Any help with this, please. 
  Thanks a lot </p>