diff --git a/test/conftest.py b/test/conftest.py index b54e253..b8b7a0f 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -1,6 +1,7 @@ +from pycallgraph import PyCallGraph, Config import tempfile -from helpers import * +import pytest @pytest.fixture(scope='module') diff --git a/test/helpers.py b/test/helpers.py index 4ea4abb..0bbee37 100644 --- a/test/helpers.py +++ b/test/helpers.py @@ -1,13 +1,6 @@ # flake8: noqa import time -import pytest - -import fix_path -from pycallgraph import * -from pycallgraph.tracer import * -from pycallgraph.output import * - def wait_100ms(): time.sleep(0.1) diff --git a/test/test_color.py b/test/test_color.py index 0d33fc5..535a577 100644 --- a/test/test_color.py +++ b/test/test_color.py @@ -1,4 +1,6 @@ -from helpers import * +from pycallgraph import ColorException, Color + +import pytest def test_bad_range(): diff --git a/test/test_config.py b/test/test_config.py index 5d5335f..ce0cbc2 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -1,4 +1,4 @@ -from helpers import * +from pycallgraph.config import Config def test_init(): diff --git a/test/test_gephi.py b/test/test_gephi.py index 15dd708..f3f2dfa 100644 --- a/test/test_gephi.py +++ b/test/test_gephi.py @@ -1,5 +1,10 @@ -from helpers import * -from calls import * +from pycallgraph import PyCallGraph +from pycallgraph.output.gephi import GephiOutput +import os + +import pytest + +from calls import one_nop @pytest.fixture diff --git a/test/test_graphviz.py b/test/test_graphviz.py index 35d8d8e..2669aed 100644 --- a/test/test_graphviz.py +++ b/test/test_graphviz.py @@ -1,5 +1,10 @@ -from helpers import * -from calls import * +from pycallgraph.output.graphviz import GraphvizOutput +from pycallgraph.pycallgraph import PyCallGraph +import os + +import pytest + +from calls import one_nop @pytest.fixture diff --git a/test/test_output.py b/test/test_output.py index 9149e5c..6b17775 100644 --- a/test/test_output.py +++ b/test/test_output.py @@ -1,4 +1,5 @@ -from helpers import * +from pycallgraph import Config +from pycallgraph.output import Output def test_set_config(): diff --git a/test/test_pycallgraph.py b/test/test_pycallgraph.py index bdc7dc4..76a2fba 100644 --- a/test/test_pycallgraph.py +++ b/test/test_pycallgraph.py @@ -1,4 +1,7 @@ -from helpers import * +from pycallgraph.exceptions import PyCallGraphException +from pycallgraph.tracer import AsyncronousTracer, SyncronousTracer + +import pytest def test_start_no_outputs(pycg): diff --git a/test/test_script.py b/test/test_script.py index 0aa9016..fad47e1 100644 --- a/test/test_script.py +++ b/test/test_script.py @@ -1,7 +1,5 @@ import subprocess -from helpers import * - def execute(arguments): command = 'PYTHONPATH=. scripts/pycallgraph ' + arguments diff --git a/test/test_trace_processor.py b/test/test_trace_processor.py index bdf16cc..7b8a0cf 100644 --- a/test/test_trace_processor.py +++ b/test/test_trace_processor.py @@ -1,9 +1,11 @@ +from pycallgraph.tracer import TraceProcessor import re import sys -from helpers import * -import calls -from pycallgraph.tracer import TraceProcessor +import pytest + +from pycallgraph import Config +from calls import one_nop, nop @pytest.fixture @@ -20,7 +22,7 @@ def test_empty(trace_processor): def test_nop(trace_processor): sys.settrace(trace_processor.process) - calls.nop() + nop() sys.settrace(None) assert trace_processor.call_dict == { @@ -32,7 +34,7 @@ def test_nop(trace_processor): def test_one_nop(trace_processor): sys.settrace(trace_processor.process) - calls.one_nop() + one_nop() sys.settrace(None) assert trace_processor.call_dict == { @@ -45,7 +47,7 @@ def stdlib_trace(trace_processor, include_stdlib): trace_processor.config = Config(include_stdlib=include_stdlib) sys.settrace(trace_processor.process) re.match("asdf", "asdf") - calls.one_nop() + one_nop() sys.settrace(None) return trace_processor.call_dict diff --git a/test/test_util.py b/test/test_util.py index 084c6f3..bf8cf09 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -1,4 +1,4 @@ -from helpers import * +from pycallgraph.util import Util def test_human_readable_biyte():