コード例 #1
0
ファイル: test_terminal.py プロジェクト: bubenkoff/pytest
def test_repr_python_version(monkeypatch):
    try:
        monkeypatch.setattr(sys, 'version_info', (2, 5, 1, 'final', 0))
        assert repr_pythonversion() == "2.5.1-final-0"
        py.std.sys.version_info = x = (2, 3)
        assert repr_pythonversion() == str(x)
    finally:
        monkeypatch.undo() # do this early as pytest can get confused
コード例 #2
0
ファイル: test_terminal.py プロジェクト: zooba/pytest
def test_repr_python_version(monkeypatch):
    try:
        monkeypatch.setattr(sys, 'version_info', (2, 5, 1, 'final', 0))
        assert repr_pythonversion() == "2.5.1-final-0"
        sys.version_info = x = (2, 3)
        assert repr_pythonversion() == str(x)
    finally:
        monkeypatch.undo()  # do this early as pytest can get confused