File: test_close.py

package info (click to toggle)
python-pygraphviz 1.14-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 760 kB
  • sloc: ansic: 5,100; python: 2,669; makefile: 64
file content (14 lines) | stat: -rw-r--r-- 257 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pygraphviz as pgv


def test_context_manager():
    with pgv.AGraph() as ag:
        ag0 = ag
    assert ag0.handle is not None


def test_double_close():
    ag = pgv.AGraph()
    ag.close()
    assert ag.handle is None
    ag.close()