jmvrbanac/Specter

Remove duplicated traceback information

Closed this issue · 0 comments

Traceback information seems to be getting duplicated between errors. In the following example, the first traceback is bleeding into the second's results:

Target Model
  ∟ Deserialization
    ∟ can deserialize from a dictionary
  ∟ Serialization
    ∟ can serialize to a summary dictionary
        Error Traceback:
          - /home/john/Repositories/github/Rift/spec/rift/data/models/target.pyc
          ------------------
            28:             summary_dict = self.target.summary_dict()
            29: 
        --> 30:             expect(summary_dict['id']).to.equal(self.example_dict['id'])
            31:             expect(summary_dict['name']).to.equal(self.example_dict['name'])
          ------------------
          - Error | KeyError: 'id'
      ✘ summary_dict['id'] self.example_dict['id']
          summary_dict['id']: fc619f5c-0844-4013-8ff0-86e0782c9978
          self.example_dict['id']: ERROR - Couldn't evaluate expected value
    ∟ can serialize to a dictionary
        Error Traceback:
          - /home/john/Repositories/github/Rift/spec/rift/data/models/target.pyc
          ------------------
            28:             summary_dict = self.target.summary_dict()
            29: 
        --> 30:             expect(summary_dict['id']).to.equal(self.example_dict['id'])
            31:             expect(summary_dict['name']).to.equal(self.example_dict['name'])
          ------------------
          - /home/john/.virtualenvs/Rift/lib/python2.7/site-packages/specter/spec.pyc
          ------------------
            54:         self.start()
            55:         try:
        --> 56:             MethodType(self.case_func, context or self)(**kwargs)
            57:         except TestIncompleteException as e:
          ------------------
          - /home/john/Repositories/github/Rift/spec/rift/data/models/target.pyc
          ------------------
            14:             target_dict = self.target.as_dict()
            15: 
        --> 16:             expect(target_dict['id']).to.equal(self.example_dict['id'])
            17:             expect(target_dict['name']).to.equal(self.example_dict['name'])
          ------------------
          - Error | KeyError: 'id'
      ✘ target_dict['id'] self.example_dict['id']