Skip to content

Commit

Permalink
Fix up
Browse files Browse the repository at this point in the history
  • Loading branch information
rh0dium committed Jun 29, 2024
1 parent 9acaa61 commit d9e119b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
8 changes: 4 additions & 4 deletions app_metrics/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from .base_tests import *
from .mixpanel_tests import *
from .statsd_tests import *
from .redis_tests import *
from .base_tests import * # noqa: F403
from .mixpanel_tests import * # noqa: F403
from .statsd_tests import * # noqa: F403
from .redis_tests import * # noqa: F403
5 changes: 2 additions & 3 deletions app_metrics/tests/base_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ def test_missing_trending(self):
this_week_date = week_for_date(datetime.date.today())
previous_week_date = this_week_date - datetime.timedelta(weeks=1)
previous_month_date = get_previous_month(this_week_date)
previous_year_date = get_previous_year(this_week_date)

MetricWeek.objects.create(metric=self.metric1, num=5, created=this_week_date)
MetricWeek.objects.create(metric=self.metric1, num=4, created=previous_week_date)
Expand Down Expand Up @@ -343,7 +342,7 @@ class MixpanelCommandTest1(TestCase):

def setUp(self):
new_metric = Metric.objects.create(name="foo bar")
i = MetricItem.objects.create(metric=new_metric)
MetricItem.objects.create(metric=new_metric)
self.old_backend = settings.APP_METRICS_BACKEND
settings.APP_METRICS_BACKEND = "app_metrics.backends.db"

Expand All @@ -361,7 +360,7 @@ class MixpanelCommandTest2(TestCase):

def setUp(self):
new_metric = Metric.objects.create(name="foo bar")
i = MetricItem.objects.create(metric=new_metric)
MetricItem.objects.create(metric=new_metric)
self.old_backend = settings.APP_METRICS_BACKEND
settings.APP_METRICS_BACKEND = "app_metrics.backends.mixpanel"

Expand Down
2 changes: 1 addition & 1 deletion app_metrics/tests/mixpanel_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured

from app_metrics.utils import *
from app_metrics.utils import * # noqa: F403


class MixpanelMetricConfigTests(TestCase):
Expand Down
9 changes: 3 additions & 6 deletions app_metrics/tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
from django.conf.urls import *
from django.conf import settings
from django.contrib import admin
from django.urls import include

admin.autodiscover()

urlpatterns = patterns(
"",
(r"^admin/", include(admin.site.urls)),
urlpatterns = [
(r"^admin/metrics/", include("app_metrics.urls")),
)
]
1 change: 1 addition & 0 deletions demo_app/demo_app/settings_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

import os
import warnings

from .settings import * # noqa: F403,F401
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ exclude = '(\.git|.venv|_build|build|dist|.*\/__pycache__\/)'

[tool.ruff]
line-length = 100
lint.ignore = ["F401"]
lint.ignore = ["F401", "F405"]

[tool.bandit]
targets = ['app_metrics']
Expand Down

0 comments on commit d9e119b

Please sign in to comment.