File: test_issue30.py

package info (click to toggle)
python-tblib 3.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 372 kB
  • sloc: python: 1,118; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 501 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pickle
import sys

import pytest

from tblib import pickling_support

pytest.importorskip('twisted')


def test_30():
    from twisted.python.failure import Failure  # noqa: PLC0415

    pickling_support.install()

    try:
        raise ValueError
    except ValueError:
        s = pickle.dumps(sys.exc_info())

    f = None
    try:
        _etype, evalue, etb = pickle.loads(s)
        raise evalue.with_traceback(etb)
    except ValueError:
        f = Failure()

    assert f is not None