5 new commits in pytest: https://bitbucket.org/pytest-dev/pytest/commits/9bf89ebf665e/ Changeset: 9bf89ebf665e User: hpk42 Date: 2015-03-17 12:19:26+00:00 Summary: remove default-verbose running Affected #: 1 file
diff -r da9d03b1f91d63ec97a989804bacfc03204b0e12 -r 9bf89ebf665e35f1ae925ce1133b1538b7317a71 tox.ini --- a/tox.ini +++ b/tox.ini @@ -136,7 +136,7 @@ minversion=2.0 plugins=pytester #--pyargs --doctest-modules --ignore=.tox -addopts= -rxsX -vl +addopts= -rxsX rsyncdirs=tox.ini pytest.py _pytest testing python_files=test_*.py *_test.py testing/*/*.py python_classes=Test Acceptance https://bitbucket.org/pytest-dev/pytest/commits/c4b0b5b71a6d/ Changeset: c4b0b5b71a6d User: hpk42 Date: 2015-03-17 12:21:44+00:00 Summary: add a project someone reported a while ago Affected #: 2 files diff -r 9bf89ebf665e35f1ae925ce1133b1538b7317a71 -r c4b0b5b71a6d3fb145ed8d2eee058f67e8dfe091 doc/en/fixture.txt --- a/doc/en/fixture.txt +++ b/doc/en/fixture.txt @@ -67,7 +67,6 @@ def test_ehlo(smtp): response, msg = smtp.ehlo() assert response == 250 - assert "merlinux" in msg assert 0 # for demo purposes Here, the ``test_ehlo`` needs the ``smtp`` fixture value. pytest diff -r 9bf89ebf665e35f1ae925ce1133b1538b7317a71 -r c4b0b5b71a6d3fb145ed8d2eee058f67e8dfe091 doc/en/projects.txt --- a/doc/en/projects.txt +++ b/doc/en/projects.txt @@ -26,6 +26,7 @@ `21000 tests <http://buildbot.pypy.org/summary?branch=%3Ctrunk%3E>`_ * the `MoinMoin <http://moinmo.in>`_ Wiki Engine * `sentry <https://getsentry.com/welcome/>`_, realtime app-maintenance and exception tracking +* `Astropy <http://www.astropy.org/>`_ and `affiliated packages <http://www.astropy.org/affiliated/index.html>`_ * `tox <http://testrun.org/tox>`_, virtualenv/Hudson integration tool * `PIDA <http://pida.co.uk>`_ framework for integrated development * `PyPM <http://code.activestate.com/pypm/>`_ ActiveState's package manager https://bitbucket.org/pytest-dev/pytest/commits/b6a56641f783/ Changeset: b6a56641f783 Branch: fix-reload User: blueyed Date: 2015-03-04 15:21:27+00:00 Summary: Fix `reload()` with modules handled via `python_files` If a module exists in `sys.modules` already, `load_module` has to return it. Fixes https://bitbucket.org/pytest-dev/pytest/issue/435 Affected #: 2 files diff -r e26175bf8246f01fc5573e92359b3124624c31b7 -r b6a56641f783b8ed18ba0ded97278875217453d3 _pytest/assertion/rewrite.py --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -146,6 +146,12 @@ return self def load_module(self, name): + # If there is an existing module object named 'fullname' in + # sys.modules, the loader must use that existing module. (Otherwise, + # the reload() builtin will not work correctly.) + if name in sys.modules: + return sys.modules[name] + co, pyc = self.modules.pop(name) # I wish I could just call imp.load_compiled here, but __file__ has to # be set properly. In Python 3.2+, this all would be handled correctly diff -r e26175bf8246f01fc5573e92359b3124624c31b7 -r b6a56641f783b8ed18ba0ded97278875217453d3 testing/test_assertrewrite.py --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -641,3 +641,27 @@ pyc.write(contents[:strip_bytes], mode='wb') assert _read_pyc(source, str(pyc)) is None # no error + + def test_reload_is_same(self, testdir): + # A file that will be picked up during collecting. + testdir.tmpdir.join("file.py").ensure() + testdir.tmpdir.join("pytest.ini").write(py.std.textwrap.dedent(""" + [pytest] + python_files = *.py + """)) + + testdir.makepyfile(test_fun=""" + import sys + try: + from imp import reload + except ImportError: + pass + + def test_loader(): + import file + assert sys.modules["file"] is reload(file) + """) + result = testdir.runpytest('-s') + result.stdout.fnmatch_lines([ + "* 1 passed*", + ]) https://bitbucket.org/pytest-dev/pytest/commits/c4fadf6761ea/ Changeset: c4fadf6761ea User: hpk42 Date: 2015-03-23 09:08:47+00:00 Summary: fix issue435: make reload() work when assert rewriting is active. Thanks Daniel Hahler. Affected #: 3 files diff -r c4b0b5b71a6d3fb145ed8d2eee058f67e8dfe091 -r c4fadf6761eaf425e624af90394b102f45122172 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ 2.7.0.dev (compared to 2.6.4) ----------------------------- +- fix issue435: make reload() work when assert rewriting is active. + Thanks Daniel Hahler. + - fix issue616: conftest.py files and their contained fixutres are now properly considered for visibility, independently from the exact current working directory and test arguments that are used. diff -r c4b0b5b71a6d3fb145ed8d2eee058f67e8dfe091 -r c4fadf6761eaf425e624af90394b102f45122172 _pytest/assertion/rewrite.py --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -146,6 +146,12 @@ return self def load_module(self, name): + # If there is an existing module object named 'fullname' in + # sys.modules, the loader must use that existing module. (Otherwise, + # the reload() builtin will not work correctly.) + if name in sys.modules: + return sys.modules[name] + co, pyc = self.modules.pop(name) # I wish I could just call imp.load_compiled here, but __file__ has to # be set properly. In Python 3.2+, this all would be handled correctly diff -r c4b0b5b71a6d3fb145ed8d2eee058f67e8dfe091 -r c4fadf6761eaf425e624af90394b102f45122172 testing/test_assertrewrite.py --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -641,3 +641,27 @@ pyc.write(contents[:strip_bytes], mode='wb') assert _read_pyc(source, str(pyc)) is None # no error + + def test_reload_is_same(self, testdir): + # A file that will be picked up during collecting. + testdir.tmpdir.join("file.py").ensure() + testdir.tmpdir.join("pytest.ini").write(py.std.textwrap.dedent(""" + [pytest] + python_files = *.py + """)) + + testdir.makepyfile(test_fun=""" + import sys + try: + from imp import reload + except ImportError: + pass + + def test_loader(): + import file + assert sys.modules["file"] is reload(file) + """) + result = testdir.runpytest('-s') + result.stdout.fnmatch_lines([ + "* 1 passed*", + ]) https://bitbucket.org/pytest-dev/pytest/commits/8d263ae18b5f/ Changeset: 8d263ae18b5f User: hpk42 Date: 2015-03-23 09:10:26+00:00 Summary: merge Affected #: 1 file diff -r c4fadf6761eaf425e624af90394b102f45122172 -r 8d263ae18b5fb1388cfdbfd26e8cdf09487f32f7 CONTRIBUTING.rst --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -38,6 +38,9 @@ - a ``README.txt`` describing how to use the plugin and on which platforms it runs. +- a ``LICENSE.txt`` file or equivalent containing the licensing + information, with matching info in ``setup.py``. + - an issue tracker unless you rather want to use the core ``pytest`` issue tracker. Repository URL: https://bitbucket.org/pytest-dev/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit