Skip to content

Fix unstubbing of __new__ #6

@awestendorf

Description

@awestendorf

This seems to be working. In writing tests for https://github.com/agoragames/torus , it seems that an expectation on the Timeseries type was not cleaned up properly, and resulted in the following error for a test that didn't try to mock out that constructor.

======================================================================
ERROR: test_match_list (test.unit.schema_test.SchemaTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/aaron/.virtualenvs/torus/local/lib/python2.7/site-packages/chai/chai.py", line 57, in wrapper
    func(self, *args, **kwargs)
  File "/home/aaron/projects/torus/test/unit/schema_test.py", line 70, in test_match_list
    s = Schema('name', config)
  File "/home/aaron/projects/torus/torus/schema.py", line 53, in __init__
    self.timeseries = Timeseries(self._client, **config)
TypeError: unbound method __new__() must be called with Timeseries instance as first argument (got type instance instead)

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