Skip to content

Commit

Permalink
Fix some style and import issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Jan 4, 2016
1 parent 77cb56c commit 3fe6698
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
14 changes: 13 additions & 1 deletion src/pytest_benchmark/fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,26 @@
import gc
import sys
import time
import traceback
from math import ceil

from .compat import INT
from .compat import XRANGE
from .stats import BenchmarkStats
from .timers import compute_timer_precision
from .utils import format_time

try:
import statistics
except (ImportError, SyntaxError):
statistics_error = traceback.format_exc()
statistics = None
else:
from .stats import BenchmarkStats


class FixtureAlreadyUsed(Exception):
pass


class BenchmarkFixture(object):
_precisions = {}
Expand Down
14 changes: 0 additions & 14 deletions src/pytest_benchmark/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@
from .utils import parse_timer
from .utils import parse_warmup

try:
import statistics
except (ImportError, SyntaxError):
statistics = False
statistics_error = traceback.format_exc()
else:
from .stats import Stats


class FixtureAlreadyUsed(Exception):
pass


def pytest_report_header(config):
bs = config._benchmarksession
Expand Down Expand Up @@ -215,8 +203,6 @@ def pytest_addhooks(pluginmanager):
method(hookspec)




def pytest_benchmark_compare_machine_info(config, benchmarksession, machine_info, compared_benchmark):
if compared_benchmark["machine_info"] != machine_info:
benchmarksession.logger.warn(
Expand Down
11 changes: 2 additions & 9 deletions src/pytest_benchmark/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from __future__ import print_function

import json
import traceback

import pytest

from .fixture import statistics
from .fixture import statistics_error
from .logger import Logger
from .storage import Storage
from .table import ResultsTable
Expand All @@ -16,14 +17,6 @@
from .utils import load_timer
from .utils import short_filename

try:
import statistics
except (ImportError, SyntaxError):
statistics = False
statistics_error = traceback.format_exc()
else:
from .stats import Stats


class PerformanceRegression(pytest.UsageError):
pass
Expand Down

0 comments on commit 3fe6698

Please sign in to comment.