Issue #6 resolved

Python 3 port of minimock

Anonymous created an issue

It would be really nice to see a Python 3 port of minimock.

Comments (10)

  1. Anonymous

    Thanks for the pointer to the discussion thread. I'll trawl through. Have fork, will code. :)

  2. jab repo owner
    • changed status to open
    • assigned issue to
      jab

    Thanks! Hope you don't have to do too much trawling. Look forward to helping with any patches I may get.

  3. Marc Abramowitz

    It looks like Python 3 works on the hg tip (the tests pass at least). I verified this by creating a branch and merging into it my tox branch (pull request #3) and my fix_test_failures_2013-03-12 branch (pull request #4) and then running tox:

    marca@marca-mac:~/dev/hg-repos/minimock$ tox
    ...
      py26: commands succeeded
      py27: commands succeeded
      py32: commands succeeded
      py33: commands succeeded
      congratulations :)
    

    However, MiniMock 1.2.7 on PyPI fails for me with Python 3.3:

    marca@marca-mac:~/python/virtualenvs$ virtualenv -p python3.3 minimock-py33
    ...
    marca@marca-mac:~/python/virtualenvs$ source minimock-py33/bin/activate
    (minimock-py33)marca@marca-mac:~/python/virtualenvs$ pip install MiniMock
    Downloading/unpacking MiniMock
      Using download cache from /Users/marca/.pip/download-cache/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FM%2FMiniMock%2FMiniMock-1.2.7.tar.gz
      Running setup.py egg_info for package MiniMock
    
    Installing collected packages: MiniMock
      Running setup.py install for MiniMock
    
    Successfully installed MiniMock
    Cleaning up...
    (minimock-py33)marca@marca-mac:~/python/virtualenvs$ python
    Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from minimock import mock, restore, Mock
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/marca/python/virtualenvs/minimock-py33/lib/python3.3/site-packages/minimock.py", line 43, in <module>
        import __builtin__
    ImportError: No module named '__builtin__'
    

    I'd suggest a new PyPI release would be nice and then this issue could be closed.

  4. Marc Abramowitz

    OK, now that a bunch of my changes are merged in, we have passing tox tests on the trunk branch.

    marca@marca-mac:~/dev/hg-repos/minimock$ tox
    ...
      py26: commands succeeded
      py27: commands succeeded
      py32: commands succeeded
      py33: commands succeeded
      congratulations :)
    

    A new PyPI release would be nice and then this issue could be closed.

  5. Marc Abramowitz

    Thank you! Looks good!

    (minimock-py33)marca@marca-mac:~/python/virtualenvs$ pip install --upgrade MiniMock
    Downloading/unpacking MiniMock from http://pypi.python.org/packages/source/M/MiniMock/MiniMock-1.2.8.tar.gz#md5=76593aaba949b5e010fec95283556449
      Downloading MiniMock-1.2.8.tar.gz
    ...
    Successfully installed MiniMock
    Cleaning up...
    (minimock-py33)marca@marca-mac:~/python/virtualenvs$ python
    Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import minimock
    >>> minimock
    <module 'minimock' from '/Users/marca/python/virtualenvs/minimock-py33/lib/python3.3/site-packages/minimock.py'>
    
  6. Log in to comment