Commit Graph

16 Commits

Author SHA1 Message Date
Bruno Oliveira b40f760cc3 Change links from bitbucket to GitHub 2015-06-15 18:28:31 -03:00
Florian Bruhin ff8d787cd5 Fix monkeypatch.setenv with string and raising=False.
Fixes #746.
2015-05-19 22:59:49 +02:00
Anatoly Bubenkov d18124f5ed support python32
--HG--
branch : python32-test-fix
2013-11-12 13:48:17 +01:00
holger krekel 0d8392bc45 fix unicode handling with new monkeypatch.setattr(import_path, value)
API.  Thanks Rob Dennis.  Fixes issue371.
2013-10-21 14:01:02 +02:00
holger krekel 39503932a4 merge monkeypatch.replace into monkeypatch.setattr, also support monkeypatch.delattr. 2013-09-27 12:33:06 +02:00
holger krekel 4b88d6d2d7 monkeypatch.replace() now only accepts a string. Improved error handling and
docs thanks to suggestions from flub, pelme, schmir, ronny.
2013-08-07 16:49:29 +02:00
holger krekel 407283ef81 a new monkeypatch.replace(target, value) call which derives the
monkeypatch location from target (can be class/module/function or
string which is taken as importable python path)
examples:

    monkeypatch.replace(os.path.abspath, lambda x: "")
    monkeypatch.replace("requests.get", ...)
2013-08-07 15:35:27 +02:00
Ronny Pfannschmidt 35cbb5791d fixes issue 156: monkeypatch class level descriptors 2012-09-25 18:15:13 +02:00
holger krekel 41ad7dbae1 fix issue185 monkeypatching time.time does not cause pytest to fail 2012-09-01 09:58:10 +02:00
Ralf Schmitt 93424b0f9c add monkeypatch.chdir method 2012-01-04 12:43:19 +01:00
Ralf Schmitt 4131923c0f test that a second undo doesn't change sys.path
also use a 'mp' funcarg that restores sys.path and the current working
directory in preparation for the monkeypatch.chdir method.
2012-01-04 12:40:57 +01:00
holger krekel fa6d5bd15b work around an apparent python2.4/python2.5 bug with subprocess.Popen,
causing jenkins failures.  Apparently "os.environ.popitem(name, None)"
is not the same as::

    try:
        del os.environ[name]
    except KeyError:
        pass
2011-12-28 15:49:13 +00:00
holger krekel 5093d8b925 fix test to actually mean something useful (thanks Jurko) 2011-12-18 10:56:39 +00:00
holger krekel 40187ec9bb robustify monkeypatch 2011-12-16 22:41:23 +00:00
holger krekel a698465487 streamline docs, especially use "import pytest" and "pytest.*" in python code examples instead of "import py" and "py.test.*". 2010-11-17 22:12:16 +01:00
holger krekel 076e03e90f also un-nest test directory 2010-11-13 11:30:40 +01:00